Robolocopy CLI
A cross-platform file copying utility with glob pattern exclusions, inspired by Windows' robocopy.
Installation
npm install -g robolocopy
Usage
robolocopy <input-path> <output-path> [-x <exclude-glob>,<exclude-glob>,...] [-X] [-V]
Or specify multiple exclude patterns individually:
robolocopy <input-path> <output-path> [-x <exclude-glob>] [-x <exclude-glob>] [-X] [-V]
Options
-x, --exclude <patterns...>
- Glob patterns to exclude, can be specified multiple times-X, --ignore-defaults
- Ignore default exclusion patterns-V, --verbose
- Enable verbose output-v, --version
- Output the current version-h, --help
- Display help information
Default Exclude Patterns
By default, the following patterns are excluded:
node_modules/**
dist/**
build/**
temp/**
delete/**
bin/**
obj/**
cache/**
tmp/**
.DS_Store
coverage/**
.cache/**
.idea/**
*.log
Examples
Copy a directory excluding node_modules:
robolocopy ./source ./destination -x "node_modules/**"
Copy with multiple exclusions:
robolocopy ./source ./destination -x "*.log" -x "temp/**"
or comma-separated
robolocopy ./source ./destination -x "node_modules,docs"
Copy with verbose output:
robolocopy ./source ./destination -V
Copy ignoring default exclude patterns:
robolocopy ./source ./destination -X
Performance
On Windows systems, the tool automatically uses the native robocopy
command for improved performance when copying directories. On other platforms, it uses an optimized Node.js implementation with batched file operations.