https://github.com/anthonyzou/copy-plus
Declarative file copying, file watching, and file compression
https://github.com/anthonyzou/copy-plus
filecompression filecopy nodejs
Last synced: about 1 month ago
JSON representation
Declarative file copying, file watching, and file compression
- Host: GitHub
- URL: https://github.com/anthonyzou/copy-plus
- Owner: Anthonyzou
- License: mit
- Created: 2019-06-27T00:27:31.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T15:25:54.000Z (over 3 years ago)
- Last Synced: 2025-05-21T10:17:24.469Z (about 1 year ago)
- Topics: filecompression, filecopy, nodejs
- Language: JavaScript
- Homepage:
- Size: 61.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Copy Plus
** Light **: Smaller than gulp
** Compression **: Can be configured for gzip or Brotli _(node 11+)_
** Watching **: Can be configured to watch directories
## Getting Started
Install copy-plus using [`yarn`](https://yarnpkg.com/en/package/copy-plus):
```bash
yarn add --dev copy-plus
```
## Usage
Configure your `package.json`
```json
{
"cppConfig": {
"watch": [
{
"dirs": ["src/**", "test/**"],
"ignore": "!**/*.ts",
"dest": "dist",
"keepPath": true,
"ignoreWatchDir": true
}
],
"copy": [
{
"dirs": ["node_modules/muicss/dist/email/*.css"],
"gz": true,
"br": true,
"dest": "dist/src/services/templates",
"keepPath": false
}
]
}
}
```
- `keepPath`: Ignores source directory structure when false
- when true: dist/src/services/templates => dist/src/services/templates/node_modules/muicss/dist/email/\*.css
- when false: dist/src/services/templates => dist/src/services/templates/.css
- `gz`: Prodce a DEST.gz file
- ignored in watch configurations
- `br`: Prodce a DEST.br file - only available on node 11.7+
- ignored in watch configurations
- `dirs`: Glob patterns to watch directories to
- `dest`: directory to place items in
- `ignoreWatchDir`: Don't use the root directory in output file structure
- `dir:["src/**"]` => `a/b/c.txt` and would not give `src/a/b/c.txt`
## Command line
# Run
```
nfc
```
# Help menu
```
Usage: index [options]
Options:
-w, --watch Watch items in the watch configuration
-h, --help output usage information
```
# Behavior
- By default items in your `watch` config will be copied at least once.
- Items in your `copy` will only be copied once per run.
- Items are only watched when using `nfc -w`
## License
copy-plus is [MIT licensed](./LICENSE).