# copy-plus

> Declare folders to copy and/or watch into a destination folder

Latest version **0.1.1** (published 2019-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install copy-plus
pnpm add copy-plus
yarn add copy-plus
bun add copy-plus
```

Provides the command `copy-plus`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-07-05 |
| First published | 2019-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.x |
| Dependencies | 4 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Anthony Ou |
| Maintainers | anthonyzou |
| Keywords | fs, watch, watchFile, watcher, watching, typescript, file, fileCopying, fileCompression, fsevents |

## Links

- npm: https://www.npmjs.com/package/copy-plus
- Repository: https://github.com/Anthonyzou/copy-plus
- Homepage: https://github.com/Anthonyzou/copy-plus#readme
- Issues: https://github.com/Anthonyzou/copy-plus/issues
- npm.io page: https://npm.io/package/copy-plus

## Dependencies (4)

- [globby](https://npm.io/package/globby.md) >=9.2.0
- [chokidar](https://npm.io/package/chokidar.md) >=3.0.1
- [fs-extra](https://npm.io/package/fs-extra.md) >=8.0.1
- [commander](https://npm.io/package/commander.md) >=2.20.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2019-07-05
- 0.1.0 — 2019-06-27
- 0.0.10 — 2019-06-27
- 0.0.9 — 2019-06-27
- 0.0.8 — 2019-06-27
- 0.0.7 — 2019-06-27
- 0.0.6 — 2019-06-27
- 0.0.5 — 2019-06-27
- 0.0.4 — 2019-06-27
- 0.0.3 — 2019-06-27
- 0.0.2 — 2019-06-27

## README

<h2 align="center">Copy Plus</h2>

** 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/<FILE>.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).

---
_Source: https://npm.io/package/copy-plus · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
