{"name":"move-file","version":"4.0.0","keywords":["move","file","mv","fs","stream","file-system","ncp","fast","quick","data","content","contents","devices","partitions"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"move-file@4.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/move-file#readme","bugs":{"url":"https://github.com/sindresorhus/move-file/issues"},"xo":{"rules":{"no-bitwise":"off"}},"dist":{"shasum":"3c3c5b6ce76d7eee38cbb6bf64528f844cb7a36e","tarball":"http://registry-npm.ywwl.com/move-file/download/move-file-4.0.0.tgz","fileCount":5,"integrity":"sha512-HLxIs6ozAZMb78KGv+sb6xJGn6X4FSW11JNAUT8AxCk6liY+DKEkifD/bQdysEn2HSCK8E9FHKpjPXmSC5L5ug==","signatures":[{"sig":"MEUCIQDunKUAWDryLohAOfIno6UoWfdcq9A0Au3udcN9Aglj9gIgI3FyciPB1/qc4tseOyldpxH3sG79QyVioDNQHoR4fwg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10293,"size":3258,"noattachment":false,"key":"/move-file/-/move-file-4.0.0.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"c99ef18c8e54e3a7ba101887429c017319c52bcd","scripts":{"test":"xo && ava && tsd"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/move-file.git","type":"git"},"_npmVersion":"11.7.0","description":"Move a file - Even works across devices","directories":{},"sideEffects":false,"_nodeVersion":"25.3.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3","ava":"^6.4.1","tsd":"^0.33.0","sinon":"^21.0.1","tempy":"^3.1.2","temp-write":"^6.0.0","@types/node":"^25.0.10"},"_npmOperationalInternal":{"tmp":"tmp/move-file_4.0.0_1769328846699_0.9113938735441727","host":"s3://npm-registry-packages-npm-production"},"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":1769328846853,"_cnpm_publish_time":1769328846853,"dist-tags":{"latest":"4.1.0"}}