{"name":"move-file","version":"3.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"},"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":{"@types/node":"^16.0.0","ava":"^5.2.0","sinon":"^15.0.3","temp-write":"^5.0.0","tempy":"^3.0.0","tsd":"^0.28.1","xo":"^0.53.1"},"xo":{"rules":{"no-bitwise":"off"}},"types":"./index.d.ts","gitHead":"333517183242c6b1943e7074dc9f5edc07b13e5c","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"homepage":"https://github.com/sindresorhus/move-file#readme","_id":"move-file@3.1.0","_nodeVersion":"16.16.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-4aE3U7CCBWgrQlQDMq8da4woBWDGHioJFiOZ8Ie6Yq2uwYQ9V2kGhTz4x3u6Wc+OU17nw0yc3rJ/lQ4jIiPe3A==","shasum":"ea9675d54852708242462bfe60d56b3c3854cdf7","tarball":"http://registry-npm.ywwl.com/move-file/download/move-file-3.1.0.tgz","fileCount":5,"unpackedSize":9710,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDNU08yxWJqTkim4bjPrA72LWOX3i0lNNMUfQof8fntLAiAjzYaauGZgEpd6UWLSJMOJrGeCNpq+NQVZqLgsbA3j9Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLWGYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8KA/+NXL3Ry8PGEfoHtrjELvGik8Xm0c8YSG9ZKRmBk9CteFlMMdT\r\n8EoQOKrDq3vrItLxKGHhrXqUmlGsmL9EY4lohxsu2B2IqE4X/7cWJHFNLTG/\r\ne+01kTWoO7N3LE3s4GuyhVptjHrdZYMo+aoCj6/zZVoVukd4QQo2Fcgz3WwH\r\nYzgokId86d4r0aMjB+3at8QCvAUBwul0jqKLt16PIhNAe1pNx0X6DmcDLjrn\r\nSixZ2hf+DjR7yZtwVG2RN/+Bj20o+2vB/bKrFDUwWkJZFdFDKZCypvKSQcLp\r\nNLY5z/quQlHBxgRM1FJHPGamypoAlF77Cua58jPFW+VyOJZFjwK07H8hBGID\r\nTgfJWIXZnXRddXec19TfB1iyi3TBX5oVeJIeVaYsSQLTwkWiUna7MEXys1zk\r\n3bwT93s0sCb9LfobbWykWap6dL0xFiPsvWTWbv0Tr4aAxnKrbJTa8lRc75vB\r\ni3cp3ABXAIbOEqbLcLLfkBS9gCnLCWy6EgEPE3QcB4c+Z9/2ciyrMtx+rDIP\r\nUJgOkAJbpKGvjKHPO5xEihkEf0RZQsaiKJnp5Ommm7X8vpKnxkugIegRDlM/\r\nMOTlhHb0jELT0OYzkGsddIKyzFyYM9FA9RQdUyax5jw/EyNqK4LgTIX4ViWc\r\npo4HinVcNphC6w7XrK0evZD+SAwFbIzkilE=\r\n=Yjdj\r\n-----END PGP SIGNATURE-----\r\n","size":3130,"noattachment":false,"key":"/move-file/-/move-file-3.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_3.1.0_1680695704028_0.9895520715265282"},"_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":1680695704187,"_cnpm_publish_time":1680695704187,"dist-tags":{"latest":"4.1.0"}}