{"_id":"move-file","_rev":"523655","name":"move-file","description":"Move a file - Even works across devices","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-08-12T10:50:46.000Z","created":"2017-11-03T11:39:21.635Z","3.0.0":"2021-08-12T10:47:39.259Z","2.1.0":"2021-06-13T06:53:49.347Z","2.0.0":"2020-04-21T08:01:44.197Z","1.2.0":"2019-04-04T04:31:58.290Z","1.1.0":"2019-03-04T05:24:19.746Z","1.0.0":"2017-12-15T10:19:58.263Z","0.2.0":"2017-11-03T12:07:51.633Z","0.1.0":"2017-11-03T11:39:21.635Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/move-file.git"},"versions":{"3.0.0":{"name":"move-file","version":"3.0.0","description":"Move a file - Even works across devices","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/move-file.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["move","file","mv","fs","stream","file-system","ncp","fast","quick","data","content","contents","devices","partitions"],"dependencies":{"path-exists":"^5.0.0"},"devDependencies":{"ava":"^3.15.0","sinon":"^11.1.2","temp-write":"^5.0.0","tempy":"^1.0.1","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"c25a740678a2f1fc88fc9404e9e069d5daca5bdc","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"homepage":"https://github.com/sindresorhus/move-file#readme","_id":"move-file@3.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.10.0","dist":{"shasum":"b2da5d7b4627e61ff5408841e81312143fa58a64","size":2559,"noattachment":false,"key":"/move-file/-/move-file-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/move-file/download/move-file-3.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-file_3.0.0_1628765259074_0.9802380405198281"},"_hasShrinkwrap":false,"publish_time":1628765259259,"_cnpm_publish_time":1628765259259},"2.1.0":{"name":"move-file","version":"2.1.0","description":"Move a file - Even works across devices","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/move-file.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10.17"},"scripts":{"test":"xo && ava && tsd"},"keywords":["move","file","mv","fs","stream","file-system","ncp","fast","quick","data","content","contents","devices","partitions"],"dependencies":{"path-exists":"^4.0.0"},"devDependencies":{"ava":"^1.4.1","sinon":"^9.0.2","temp-write":"^4.0.0","tempy":"^0.5.0","tsd":"^0.11.0","xo":"^0.24.0"},"gitHead":"0f39a71347f85a2bf3e6435795e85ede7e5ce1da","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"homepage":"https://github.com/sindresorhus/move-file#readme","_id":"move-file@2.1.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"shasum":"3bec9d34fbe4832df6865f112cda4492b56e8507","size":2592,"noattachment":false,"key":"/move-file/-/move-file-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/move-file/download/move-file-2.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-file_2.1.0_1623567229226_0.04132602870393165"},"_hasShrinkwrap":false,"publish_time":1623567229347,"_cnpm_publish_time":1623567229347},"2.0.0":{"name":"move-file","version":"2.0.0","description":"Move a file - Even works across devices","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/move-file.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10.17"},"scripts":{"test":"xo && ava && tsd"},"keywords":["move","file","mv","fs","stream","file-system","ncp","fast","quick","data","content","contents","devices","partitions"],"dependencies":{"path-exists":"^4.0.0"},"devDependencies":{"ava":"^1.4.1","sinon":"^9.0.2","temp-write":"^4.0.0","tempy":"^0.5.0","tsd":"^0.11.0","xo":"^0.24.0"},"gitHead":"63bf2f051bb6a885d567928d139be6b2a9e9bfaf","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"homepage":"https://github.com/sindresorhus/move-file#readme","_id":"move-file@2.0.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"83ffa309b5d7f69d518b28e1333e2ffadf331e3e","size":2530,"noattachment":false,"key":"/move-file/-/move-file-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/move-file/download/move-file-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-file_2.0.0_1587456104076_0.4955431144809628"},"_hasShrinkwrap":false,"publish_time":1587456104197,"_cnpm_publish_time":1587456104197},"1.2.0":{"name":"move-file","version":"1.2.0","description":"Move a file - Even works across devices","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/move-file.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["move","file","mv","fs","stream","file-system","ncp","fast","quick","data","content","contents","devices","partitions"],"dependencies":{"cp-file":"^6.1.0","make-dir":"^3.0.0","path-exists":"^3.0.0"},"devDependencies":{"ava":"^1.4.1","sinon":"^7.3.1","temp-write":"^3.4.0","tempy":"^0.2.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"47a28e65df110b1011e2929e93ba107d2e115b45","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"homepage":"https://github.com/sindresorhus/move-file#readme","_id":"move-file@1.2.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"789f92d276c62511d214b1b285aa16e015c2f2fc","size":2686,"noattachment":false,"key":"/move-file/-/move-file-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/move-file/download/move-file-1.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-file_1.2.0_1554352318082_0.7039863250418468"},"_hasShrinkwrap":false,"publish_time":1554352318290,"_cnpm_publish_time":1554352318290},"1.1.0":{"name":"move-file","version":"1.1.0","description":"Move a file - Even works across devices","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/move-file.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["move","file","mv","fs","stream","file-system","ncp","fast","quick","data","content","contents","devices","partitions"],"dependencies":{"cp-file":"^6.0.0","make-dir":"^2.1.0","path-exists":"^3.0.0"},"devDependencies":{"ava":"^1.2.1","sinon":"^7.2.6","temp-write":"^3.3.0","tempy":"^0.2.1","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"2ad6e72eefa14911ff9d6511ce9d109e25ed30bc","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"homepage":"https://github.com/sindresorhus/move-file#readme","_id":"move-file@1.1.0","_nodeVersion":"10.15.1","_npmVersion":"6.8.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e670ee4da60d3815b9a843b50f54e0d0af575984","size":2619,"noattachment":false,"key":"/move-file/-/move-file-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/move-file/download/move-file-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-file_1.1.0_1551677059577_0.455728116035389"},"_hasShrinkwrap":false,"publish_time":1551677059746,"_cnpm_publish_time":1551677059746},"1.0.0":{"name":"move-file","version":"1.0.0","description":"Move a file - Even works across devices","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/move-file.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["move","file","mv","fs","stream","file-system","ncp","fast","quick","data","content","contents","devices","partitions"],"dependencies":{"cp-file":"^5.0.0","make-dir":"^1.1.0","path-exists":"^3.0.0"},"devDependencies":{"ava":"*","sinon":"^4.1.0","temp-write":"^3.3.0","tempy":"^0.2.1","xo":"*"},"gitHead":"3a72d2029e574faa655bb8b360eb867932e07ea0","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"homepage":"https://github.com/sindresorhus/move-file#readme","_id":"move-file@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c90dcd6c03497ed8253a1a02433703d6e4838440","size":2325,"noattachment":false,"key":"/move-file/-/move-file-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/move-file/download/move-file-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-file-1.0.0.tgz_1513333197462_0.7075600128155202"},"directories":{},"publish_time":1513333198263,"_hasShrinkwrap":false,"_cnpm_publish_time":1513333198263},"0.2.0":{"name":"move-file","version":"0.2.0","description":"Move a file - Even works across devices","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/move-file.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["move","file","mv","fs","stream","file-system","ncp","fast","quick","data","content","contents","devices","partitions"],"dependencies":{"cp-file":"^5.0.0","make-dir":"^1.1.0","path-exists":"^3.0.0"},"devDependencies":{"ava":"*","sinon":"^4.1.0","temp-write":"^3.3.0","tempy":"^0.2.1","xo":"*"},"gitHead":"69d55a2681f128c91220e725e056bb06d284312b","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"homepage":"https://github.com/sindresorhus/move-file#readme","_id":"move-file@0.2.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"f96c6826ab66d2155bdd69bfd908795327e86faa","size":2322,"noattachment":false,"key":"/move-file/-/move-file-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/move-file/download/move-file-0.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-file-0.2.0.tgz_1509710871387_0.5595400780439377"},"directories":{},"publish_time":1509710871633,"_hasShrinkwrap":false,"_cnpm_publish_time":1509710871633},"0.1.0":{"name":"move-file","version":"0.1.0","description":"Move a file - Even works across devices","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/move-file.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["move","file","mv","fs","stream","file-system","ncp","fast","quick","data","content","contents","devices","partitions"],"dependencies":{"cp-file":"^5.0.0","make-dir":"^1.1.0","path-exists":"^3.0.0"},"devDependencies":{"ava":"*","sinon":"^4.1.0","temp-write":"^3.3.0","tempy":"^0.2.1","xo":"*"},"gitHead":"19cc6f0ac371e112f562a84ebd1892fa070c5576","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"homepage":"https://github.com/sindresorhus/move-file#readme","_id":"move-file@0.1.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"f9a6c8e1d568908726525d37f653b89e2582cca7","size":2372,"noattachment":false,"key":"/move-file/-/move-file-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/move-file/download/move-file-0.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-file-0.1.0.tgz_1509709161571_0.783038352848962"},"directories":{},"publish_time":1509709161635,"_hasShrinkwrap":false,"_cnpm_publish_time":1509709161635}},"readme":"# move-file\n\n> Move a file\n\nThe built-in [`fs.rename()`](https://nodejs.org/api/fs.html#fs_fs_rename_oldpath_newpath_callback) is just a JavaScript wrapper for the C `rename(2)` function, which doesn't support moving files across partitions or devices. This module is what you would have expected `fs.rename()` to be.\n\n## Highlights\n\n- Promise API.\n- Supports moving a file across partitions and devices.\n- Optionally prevent overwriting an existing file.\n- Creates non-existent destination directories for you.\n\n## Install\n\n```\n$ npm install move-file\n```\n\n## Usage\n\n```js\nimport {moveFile} from 'move-file';\n\nawait moveFile('source/unicorn.png', 'destination/unicorn.png');\nconsole.log('The file has been moved');\n```\n\n## API\n\n### moveFile(sourcePath, destinationPath, options?)\n\nReturns a `Promise` that resolves when the file has been moved.\n\n### moveFileSync(sourcePath, destinationPath, options?)\n\n#### sourcePath\n\nType: `string`\n\nThe file you want to move.\n\n#### destinationPath\n\nType: `string`\n\nWhere you want the file moved.\n\n#### options\n\nType: `object`\n\n##### overwrite\n\nType: `boolean`\\\nDefault: `true`\n\nOverwrite existing destination file.\n\n##### directoryMode\n\nType: `number`\\\nDefault: `0o777`\n\n[Permissions](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation) for created directories.\n\nIt has no effect on Windows.\n\n## Related\n\n- [move-file-cli](https://github.com/sindresorhus/move-file-cli) - CLI for this module\n- [cp-file](https://github.com/sindresorhus/cp-file) - Copy a file\n- [cpy](https://github.com/sindresorhus/cpy) - Copy files\n- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed\n","_attachments":{},"homepage":"https://github.com/sindresorhus/move-file#readme","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"license":"MIT"}