{"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":{"integrity":"sha512-49sukC4S6SZDhbyWWW/JwIZRLtV14RVapTfxtwa2kB9DyLt+XdtrwovrQiWip67zWrAGKVw9mQS1SsrXe2aopw==","shasum":"e670ee4da60d3815b9a843b50f54e0d0af575984","tarball":"http://registry-npm.ywwl.com/move-file/download/move-file-1.1.0.tgz","fileCount":5,"unpackedSize":5973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfLaECRA9TVsSAnZWagAAmgQP/RmFLwQ07UjwMBDz1r/P\n2CoFhwJ6808Mt4OYqM++ipmjjpp6DM6D1nqit9wJby+v8Pwy8q7JWdMPrpL/\nety2gh73/bF36Ci9utZjGg5AzOnCBmF21MPaGGVkepEqnfPOh1ruTFbtIU9c\nx4TmhKunN+teFSdnKWV5YYDixPQTz7rqb07Ykm1pi3LoBTbcWfIZZoTxt/Uc\ndzyQnkazdzShHJisrSLLX6JccZCbrPx3c1NRoROlSDyzj2ftkRkLWUvjwZTk\nY5E7eMX9Wa7xk6Wr/S+/9quw/9ClfR0vEDnIhVRFAIjxgQpih9YCeydhHaYo\nUiES6vVFzqb5bMbZp1e6rk5EaggBqU/fHJzqZmazzPI/qjvN5PhiqwAq51lm\nRFsoaRNfsiENqIAXrHVqTrMWSSpqojWaHOO7aV45uzQ3G7SVk9MLWfWYyhzJ\nncFd6bzBUI+8rGcOxs+EVEtUFoXdkXU/GHtOv38PYKqDAv6wt1sF8XoKIgq2\nWbv11tXAf1HUhqf0kpQ+fYYp6R04lqsuNgiq7dqfC64h0/lRCAQ+I29/Kofd\nSpichxmRHKFPHACQwdA+ZO92xawToODLAoTf0TMkcEahCISn7W+HoQjjFl+f\nTpDg3FgyNo8lB0eK6bQedo91XxgnuTBfPNZiQ660fDpi49Nwi+lddk/mRCVX\nfb53\r\n=KcqU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJyLkl1LJalQZK1xHMggBC8t9owPdp1bdIqKc6E806sQIgBHqjF6JsV9dy7R5z8ltdLWQIRuY24jFZR7kcPc5FNEA="}],"size":2619,"noattachment":false,"key":"/move-file/-/move-file-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-file_1.1.0_1551677059577_0.455728116035389"},"_hasShrinkwrap":false,"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```sh\nnpm 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\nSee [Options](#options-2).\n\n### renameFile(source, destination, options?)\n\nReturns a `Promise` that resolves when the file has been renamed. `source` and `destination` must be in the same directory.\n\n### renameFileSync(source, destination, options?)\n\n#### source\n\nType: `string`\n\nThe file you want to rename.\n\n#### destination\n\nType: `string`\n\nWhat you want to rename the file to.\n\n#### options\n\nType: `object`\n\nSee [Options](#options-2).\n\n### Options\n\n##### overwrite\n\nType: `boolean`\\\nDefault: `true`\n\nOverwrite existing destination file.\n\n##### cwd\n\nType: `string`\\\nDefault: `process.cwd()`\n\nThe working directory to find source files.\n\nThe source and destination path are relative to this.\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","publish_time":1551677059746,"_cnpm_publish_time":1551677059746,"dist-tags":{"latest":"4.1.0"}}