mv (Node.js)

JSON →
library 2.1.1 ·javascript abandoned
verified May 27, 2026

The `mv` package by `andrewrk` provides a robust utility for moving files and directories in Node.js, specifically addressing the limitation of `fs.rename` which cannot perform operations across different devices or file systems. It first attempts a standard `fs.rename` and, upon failure (e.g., cross-device boundary), transparently falls back to a copy-then-unlink strategy. For files, this involves piping data, and for directories, it utilizes a recursive copy (`ncp`) followed by removal of the source (`rimraf`). It supports options like automatically creating destination parent directories (`mkdirp: true`) and preventing overwrites (`clobber: false`). The current stable version, `2.1.1`, was released in 2015. Given its age and lack of recent updates, this package is considered abandoned. Developers are advised to consider actively maintained alternatives, such as `move-file`, which offer modern Promise-based APIs and enhanced ESM support, if possible.

total hits 10
actors 5 distinct systems
last hit 3d ago AhrefsBot
GPTBot
2
Script
1
ClaudeBot
1

top countries 🇨🇦 Canada · 🇫🇷 France · 🇺🇸 United States · 🇩🇪 Germany