An open API service indexing awesome lists of open source software.

https://github.com/brikcss/watcher-cli

CLI utility to watch files and do stuff when a they change.
https://github.com/brikcss/watcher-cli

Last synced: about 2 months ago
JSON representation

CLI utility to watch files and do stuff when a they change.

Awesome Lists containing this project

README

        

# Watcher CLI

> CLI utility to watch files and do stuff when they change. A tiny wrapper around [chokidar](https://www.npmjs.com/package/chokidar).




NPM version



NPM downloads per month



Travis branch



Commitizen friendly



semantic release



code style: prettier



## Install

```sh
npm install -D @brikcss/watcher-cli
```

## Usage

- To watch files and run a shell command:

```sh
watch --exec=""
```

- To watch files and run a script:

```sh
watch --script=""
```

- To watch files and run chokidar with a config file:

```sh
watch --config=
```

## Configuration File

The config file is simply passed to chokidar, and it accepts any of [chokidar's options](https://github.com/paulmillr/chokidar#getting-started).

### Event listeners

The `config.on` property is reserved for chokidar's event listeners, and is attached to the chokidar instance. Any chokidar event can be passed here.

### Multiple watchers

You may configure multiple watchers via the config file. To do this, add an `id` for each watcher you wish to create. To run the configuration for that id, simply run:

```sh
watch --config= --id=
```

## Environment support

| Node | CLI | UMD | Browser |
|:-------|:-----:|:------|:----------|
| 𐄂 | ✔ | 𐄂 | 𐄂 |