{"name":"move-file","version":"4.1.0","description":"Move a file, directory, or symlink - 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":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["move","file","directory","folder","symlink","mv","fs","file-system","devices","partitions"],"devDependencies":{"@types/node":"^25.0.10","ava":"^6.4.1","sinon":"^21.0.1","temp-write":"^6.0.0","tempy":"^3.1.2","tsd":"^0.33.0","xo":"^1.2.3"},"xo":{"rules":{"no-bitwise":"off"}},"gitHead":"e1566bbfb25e5ec2da7920a7b29ab3365cb6077d","types":"./index.d.ts","_id":"move-file@4.1.0","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"homepage":"https://github.com/sindresorhus/move-file#readme","_nodeVersion":"25.3.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-YE06K9XLIvMlqSfoZTl32qvbZLPgL70Za41wS8pEhsSOhy71xz2fn8J07nuz/LEEtPSuUzLUFGAJSx499eKDSw==","shasum":"d6fbd83782f71e11fb4767440b9dc16d23f8252a","tarball":"http://registry-npm.ywwl.com/move-file/download/move-file-4.1.0.tgz","fileCount":5,"unpackedSize":10456,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD5GM0RQl8fLOoHB46+TqY06GC/nLwwrGxd6DIKRP7cTQIhAN1J9G+yB+xyzxa44lx1Uj89N1Xk3eaglJwqvPXPVrc0"}],"size":3241,"noattachment":false,"key":"/move-file/-/move-file-4.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/move-file_4.1.0_1769330586330_0.5029778754692102"},"_hasShrinkwrap":false,"readme":"# move-file\n\n> Move a file, directory, or symlink\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, directory, or symlink 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, directory, or symlink has been moved.\n\n### moveFileSync(sourcePath, destinationPath, options?)\n\n#### sourcePath\n\nType: `string`\n\nThe file, directory, or symlink you want to move.\n\n#### destinationPath\n\nType: `string`\n\nWhere you want it 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- [copy-file](https://github.com/sindresorhus/copy-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":1769330586460,"_cnpm_publish_time":1769330586460,"dist-tags":{"latest":"4.1.0"}}