{"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":{"integrity":"sha512-v6u4XjX3MFW6Jo1V/YfbhC7eiGSgvYPJ/NM+aGtTtB9/Y6IYj7YViaHu6dkgDsZFB7MbnAoSI5+Z26XZXnP0vg==","shasum":"b2da5d7b4627e61ff5408841e81312143fa58a64","tarball":"http://registry-npm.ywwl.com/move-file/download/move-file-3.0.0.tgz","fileCount":5,"unpackedSize":6353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFPxLCRA9TVsSAnZWagAAfosP+wdFyByPQzy9wv0jNcOW\nYXs3XTpHkga5y/tTiXof9GZ1lfxR9gJM3hcJbkFqZ8wDXCCJinkmNA+D77Se\npFf7hs2ypMMZeztbptyuT9bD6ominZn3FMa/0MdPg8FHim/Igd09IxtxdghD\ndT/wf472VPCDBNHCAx38ZWvUHxhsTwjfYpte2EvmNEpQHuq13XywOhWaDNxv\ntLOa8fiF5/2NgBvK5moIhmSfbB/s8KxUhJno73XpDuTdC3gXIkWOQlBIF8Cs\nX1bNBuO2x841AOhDJVGlH0mSYirevjgjOjYkiK/YqlL4/xFsqFSvt/VSwQdM\nP5nms8oqrggKlP6fAig3fjrOCRThHvqndXIX9LnqpSXxznsZDoAJlpl8qvnS\nMOjQeuT33CbhW7SXN4hQsEmDer+lLGhmlWYCZ5jbTZT6qUr/zPbfGgH3Q43R\nOzSmRSWDIcBsdopz80vL+sOGNXF8RAUPvXXY6sw+Ts+KZlwhCxsEWwjCH3lW\nWmo6/MI+GgStj7VC+IkcN3jYUCoTqp0WrC9c3ghwfdVMdU47NuncM9rTM+oQ\nUEv0e2+q0Rkbo+oAqftmXDqqiV+y9TiufBtAunu+4prga8ZdGKGXBzLQRU5z\nchdfGklOSIetU1Ff0Upnas1B7A+i8pw6fdmTMu7BRusvFzLOopfA4qi2SCeD\nxGhp\r\n=ykBV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICPQ5wK70aQjtffuTKz+Podwmt+t2TTIUD0rYvyBfRjNAiBpqlmAiFsTGgdCq02kqOSPfKTzi6L1x+PBVWcPH6i2EQ=="}],"size":2559,"noattachment":false,"key":"/move-file/-/move-file-3.0.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.0.0_1628765259074_0.9802380405198281"},"_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":1628765259259,"_cnpm_publish_time":1628765259259,"dist-tags":{"latest":"4.1.0"}}