file-copy-cli
v1.0.1
Published
A tiny CLI to copy a file from one path to another with a small extension mismatch warning.
Readme
file-copy-cli
A tiny CLI to copy a file from one path to another with a small extension mismatch warning.
Prerequisites
- Node.js 18+ (tested with ESM support)
- npm (comes with Node.js)
Install and Use Locally (no global install)
- Install dependencies (none, but this ensures
node_modulesandpackage-lockexist):npm install file-copy-cli - Run with npm exec:
npm exec fcopy <source> <destination> - Or use the local binary via npx:
npx fcopy <source> <destination>
Install and Use Globally
- Install globally from the project root:
npm install -g file-copy-cli - Now the command
fcopyis available everywhere:fcopy <source> <destination>
Notes
- The tool warns if source and destination extensions differ; the copy still proceeds.
- Both
<source>and<destination>must be valid paths; missing arguments will throw an error. - Overwrites the destination file if it already exists (default
fs.copyFilebehavior).
Examples
# Copy using npm exec (local project context)
npm exec fcopy ./notes/todo.txt ./backup/todo.txt
# Using global install
fcopy ./images/logo.png ./public/logo.png
# Using npx without global install
npx fcopy ./data/input.json ./data/output.json