diff --git a/lib/util/move-file.js b/lib/util/move-file.js index b5d7a25..84130b2 100644 --- a/lib/util/move-file.js +++ b/lib/util/move-file.js @@ -5,7 +5,7 @@ const util = require('util') const chmod = util.promisify(fs.chmod) const unlink = util.promisify(fs.unlink) const stat = util.promisify(fs.stat) -const move = require('move-file') +const move = require('@npmcli/move-file') const pinflight = require('promise-inflight') module.exports = moveFile diff --git a/package-lock.json b/package-lock.json index 0114ff3..88c533b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -193,6 +193,14 @@ "to-fast-properties": "^2.0.0" } }, + "@npmcli/move-file": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.0.1.tgz", + "integrity": "sha512-Uv6h1sT+0DrblvIrolFtbvM1FgWm+/sy4B3pvLp67Zys+thcukzS5ekn7HsZFGpWP4Q3fYJCljbWQE/XivMRLw==", + "requires": { + "mkdirp": "^1.0.4" + } + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -3341,21 +3349,6 @@ "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", "dev": true }, - "move-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/move-file/-/move-file-2.0.0.tgz", - "integrity": "sha512-cdkdhNCgbP5dvS4tlGxZbD+nloio9GIimP57EjqFhwLcMjnU+XJKAZzlmg/TN/AK1LuNAdTSvm3CPPP4Xkv0iQ==", - "requires": { - "path-exists": "^4.0.0" - }, - "dependencies": { - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - } - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/package.json b/package.json index f585304..59b8acf 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ ], "license": "ISC", "dependencies": { + "@npmcli/move-file": "^1.0.1", "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "glob": "^7.1.4", @@ -68,7 +69,6 @@ "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.2", "mkdirp": "^1.0.3", - "move-file": "^2.0.0", "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", diff --git a/test/util.move-file.js b/test/util.move-file.js index e273a53..ba9e6f0 100644 --- a/test/util.move-file.js +++ b/test/util.move-file.js @@ -170,11 +170,8 @@ test('fallback to renaming on missing files post-move', function (t) { } const mockedMoveFile = requireInject.withEmptyCache('../lib/util/move-file', { fs: mockFS, - 'move-file': requireInject.withEmptyCache('move-file', { - fs: mockFS, - 'path-exists': requireInject.withEmptyCache('path-exists', { - fs: mockFS - }) + '@npmcli/move-file': requireInject.withEmptyCache('@npmcli/move-file', { + fs: mockFS }) })