@engineer.dilnawaz.khan/copy-cli
v1.0.4
Published
A simple and fast **CLI tool** to copy files from one location to another — built with modern Node.js and ES Modules.
Maintainers
Readme
A simple and fast CLI tool to copy files from one location to another — built with modern Node.js and ES Modules.
You can:
- Copy any file to a desired location
- Run it globally from anywhere as a CLI
- View help and version info
Features
- ⚡ Fast and lightweight
- 🖥️ Works globally via npm
- 🧩 Supports
--helpand--version - 🧠 Handles text, images, or any binary file
- 📦 Built with modern Node.js (
fs/promises, ESM)
Requirements
- Node.js v20+ (recommended: latest LTS)
Installation
Install globally using npm:
npm install -g @engineer.dilnawaz.khan/copy-cliUsage
Copy a file
copy <source-file> <destination-folder>Example:
copy ./image.png /Users/dilnawazkhan/DesktopOutput:
Image paste successfullyNote: The destination folder must exist.
CLI Flags
--help→ Show usage information
copy --helpOutput Example:
Usage:
copy <source> <destination>
Options:
--help Show help
--version Show version--version→ Show current version of the CLI
copy --versionOutput Example:
copy v1.0.0How It Works
- Reads the source file using
node:fs/promises - Writes the file to the destination path
- Maintains binary integrity (works for text or images)
- Case-insensitive handling of file names is handled by OS
Local Development
Clone the repository and link it locally:
git clone https://github.com/engineer-dilnawaz/copy-cli.git
cd copy
npm install
npm linkTest it:
copy ./test.txt ~/DesktopUnlink after testing:
npm unlinkProject Structure
├── task.js # CLI entry point
├── package.json
└── README.mdCLI Implementation Notes
- Uses shebang:
#!/usr/bin/env node - Exposed via the
binfield inpackage.json - Distributed as a global npm CLI
- Node ≥20 required for
import.meta.dirname
License
MIT © Dilnawaz Khan
Author
Dilnawaz Khan
Frontend / Full-Stack Engineer
npm: @engineer.dilnawaz.khan
Future Improvements
- Support for copying folders recursively (
-rflag) - Overwrite confirmation
- Progress output for large files
- Auto-create destination folder if missing
⭐ If you find this useful, consider starring the repository or sharing feedback!
