{"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":{"integrity":"sha512-i9qLW6gqboJ5Ht8bauZi7KlTnQ3QFpBCvMvFfEcHADKgHGeJ9BZMO7SFCTwHPV9Qa0du9DYY1Yx3oqlGt30nXA==","shasum":"3bec9d34fbe4832df6865f112cda4492b56e8507","tarball":"http://registry-npm.ywwl.com/move-file/download/move-file-2.1.0.tgz","fileCount":5,"unpackedSize":6152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxat9CRA9TVsSAnZWagAAW/UQAKIVzIWktCLznFjyvLjJ\nlq73HPDp8nCPonSM4Qc7HkwB41fVqEBIJUCFROMbJMyGlhpv1pYd4Y4ZeGW9\n6afKk2udV+1t+IWXgcmWwZzZK4316TUq3OKuVh35ST47nMwgsTcP1/ef/e30\nIwbAy/nb8czL6bakXkaIWRkGt8l2qf0MGgqvFitp2DLAb4S2LDjEfX5MIvCA\n0o1b5JKg8X6H0GqyH8H0n8dOpdXdETf8+QQMH3rVSiDsVgYLStPvS8coTxB4\nKLGJ7B1YNP6ljW/QwMyYvE4sTzPIHQ7iMF6ESynprkzmRgPCxXR3ECJG/8ET\nf9VJdBN2uWf1WwmjRs0SvJ96Vbg57tMrBdAFRH16bI1h+ydv8YRyREZHimoU\nZdoV60Mdcw0NWZDs20t3Yugc9n1+UjAQXkTTYJkBy0FZc1Csw2BgarLdKXoc\nZHupjK1qDvEnR5t6++owImUaNeNtBqeP5YtIFDfMHtfY9i0baIg0e9M4ZY4e\n6uTNqnB+6LEPiGz3SnaYK+DSr78Je+rCGVIbYtMhGcntD0Jtb7b6EY9Zdg/n\nSS7PEW2xdPdIt2SU9UE5OCdkAT2clTN3HBCtenJMCf0ubE5aclDU2On78SpX\n4lv4Kc+7ndNMULGoawfoNuJq2B+UniKAKOijk28Y2nN2oPTDW0TqqSclD9vu\nIGG8\r\n=/XpS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDw2AcAMI82JZIkdoXFoIn6Gfc+a8VwyzCoHUUfuW7TYwIgKAIM0aRRFs8DBgkVK+QbrfqtQ/bD1g8uVaYOSnhl/B0="}],"size":2592,"noattachment":false,"key":"/move-file/-/move-file-2.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/move-file_2.1.0_1623567229226_0.04132602870393165"},"_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":1623567229347,"_cnpm_publish_time":1623567229347,"dist-tags":{"latest":"4.1.0"}}