Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/cpy-cli
Copy files
https://github.com/sindresorhus/cpy-cli
Last synced: 6 days ago
JSON representation
Copy files
- Host: GitHub
- URL: https://github.com/sindresorhus/cpy-cli
- Owner: sindresorhus
- License: mit
- Created: 2016-01-03T21:04:57.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-02-03T06:20:19.000Z (about 1 year ago)
- Last Synced: 2025-02-08T11:05:55.284Z (13 days ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 351
- Watchers: 8
- Forks: 34
- Open Issues: 16
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
- Security: .github/security.md
Awesome Lists containing this project
README
# cpy-cli
> Copy files
## Why
- Fast by using streams.
- Resilient by using [graceful-fs](https://github.com/isaacs/node-graceful-fs).
- User-friendly by accepting [globs](https://github.com/sindresorhus/globby#globbing-patterns) and creating non-existent destination directories.
- User-friendly error messages.## Install
```sh
npm install --global cpy-cli
```## Usage
```
$ cpy --helpUsage
$ cpyOptions
--no-overwrite Don't overwrite the destination
--cwd= Working directory for files
--rename= Rename all filenames to . Supports string templates.
--dot Allow patterns to match entries that begin with a period (.)
--flat Flatten directory structure. All copied files will be put in the same directory.
--concurrency Number of files being copied concurrentlycan contain globs if quoted
Examples
Copy all .png files in src folder into dist except src/goat.png
$ cpy 'src/*.png' '!src/goat.png' distCopy all files inside src folder into dist and preserve path structure
$ cpy . '../dist/' --cwd=srcCopy all .png files in the src folder to dist and prefix the image filenames
$ cpy 'src/*.png' dist --cwd=src --rename=hi-{{basename}}
```## Related
- [cpy](https://github.com/sindresorhus/cpy) - API for this module