# config-watcher-cli

> a tool used to monitor a config file and trigger a command

Latest version **0.0.2** (published 2018-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install config-watcher-cli
pnpm add config-watcher-cli
yarn add config-watcher-cli
bun add config-watcher-cli
```

Provides the command `config-watcher`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-04-20 |
| First published | 2018-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 15.4 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Ailun She |
| Maintainers | jf3096 |
| Keywords | config-watcher |

## Links

- npm: https://www.npmjs.com/package/config-watcher-cli
- npm.io page: https://npm.io/package/config-watcher-cli

## Dependencies (3)

- [shelljs](https://npm.io/package/shelljs.md) 0.8.1
- [chokidar](https://npm.io/package/chokidar.md) 2.0.3
- [commander](https://npm.io/package/commander.md) 2.15.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2018-04-20

## README

# config-watcher-cli

a tool used to watch config file and react when the config file has been changed.

## Installation

```shell
  npm i config-watcher-cli -g
```

## How to use

Open your command line or shell and key in,

`config-watcher-cli -s <source of your images> -d <destination of your images>`

```
    Usage: index [options]
  
    Options:
  
      -V, --version             output the version number
      -c, --config <value>      config file path
      -C, --cmd <value>         if any changes from config file can trigger current cmd
      -w, --watch-mode [value]  watch file mode [add, change, unlink], default: add and change
      -h, --help                output usage information
```

### watch-mode

Listen for an FS event. Available events: add, change, unlink. default is add and change if no set.

## Example

common case, lets say if we need to watch the shadowsocks.json. If any changes applies to it, it will restart the shadowsocks:

`config-watcher-cli -c "/etc/shadowsocks.json" -C "ssserver -c /etc/shadowsocks.json -d restart"`

with specific watch mode, react whenever delete target file:

`config-watcher-cli -c "/etc/shadowsocks.json" -C "ssserver -c /etc/shadowsocks.json -d restart" -w "unlink"` 

## Author
Ailun She

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