move-cli: Robust File & Directory Mover CLI

2.0.0 · active · verified Wed Apr 22

move-cli is a command-line interface (CLI) tool designed to move files and directories, acting as a robust alternative to `fs.rename` and mimicking the Unix `mv` utility. Its key differentiator is the ability to move items across different storage devices and to handle directories recursively, which standard `fs.rename` does not support natively. The package is built upon `andrewrk/node-mv` for its underlying moving logic. The current stable version is 2.0.0, released in late 2023, primarily focusing on dependency vulnerability fixes and CLI option parsing corrections. Its release cadence appears to be driven by maintenance and security updates rather than frequent feature additions, making it a stable choice for automated scripts and build processes.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates global installation, moving single files, moving directories with parent creation, and moving multiple files with glob patterns and no-clobber option.

npm install -g move-cli

# Create some dummy files and directories
mkdir -p source/folder1 source/folder2
touch source/folder1/file1.txt source/folder2/file2.js

# Move a single file
move-cli source/folder1/file1.txt destination/newfile.txt

# Move a directory (and create destination parent if needed)
move-cli source/folder2 destination/new_folder --mkdirp

# Move multiple files using a glob pattern, preventing overwrite
move-cli 'source/**/*.js' other_destination --noclobber

view raw JSON →