# nitewatch

> Watch for file changes and run scripts easily

Latest version **2.1.3** (published 2018-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install nitewatch
pnpm add nitewatch
yarn add nitewatch
bun add nitewatch
```

Provides the command `nitewatch`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2018-08-10 |
| First published | 2018-07-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 19.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jared Grady |
| Maintainers | thefenderstory |

## Links

- npm: https://www.npmjs.com/package/nitewatch
- npm.io page: https://npm.io/package/nitewatch

## Dependencies (5)

- [md5](https://npm.io/package/md5.md) ^2.2.1
- [fs-walk](https://npm.io/package/fs-walk.md) 0.0.2
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.12.0
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.4
- [command-line-args](https://npm.io/package/command-line-args.md) ^5.0.2

## Recent versions

- 2.1.3 (latest) — 2018-08-10
- 2.1.2 — 2018-08-10
- 2.1.1 — 2018-08-10
- 2.1.0 — 2018-08-09
- 2.0.2 — 2018-07-29
- 2.0.1 — 2018-07-29
- 2.0.0 — 2018-07-29
- 1.0.0 — 2018-07-28

## README

# nitewatch [![travis Status](https://travis-ci.org/TheFenderStory/nitewatch.svg?branch=master)](https://travis-ci.org/TheFenderStory/nitewatch) [![dependencies Status](https://david-dm.org/thefenderstory/nitewatch/status.svg)](https://david-dm.org/thefenderstory/nitewatch) [![devDependencies Status](https://david-dm.org/thefenderstory/nitewatch/dev-status.svg)](https://david-dm.org/thefenderstory/nitewatch?type=dev)
nitewatch monitors files within your project for changes and then automatically runs scripts or commands
you have to defined. For example, nitewatch can automatically recompile code in a project when a file is modified,
sparing you the overhead and letting you focus on writing code.

## Install

Install globally
```
$ npm install -g nitewatch
```

Or within a project
```
$ npm install nitewatch --save
```

## Usage
nitewatch can be run within another script:
```js
const nitewatch = require("nitewatch");

const userOpts = {
    ignoredFiles: {"test.js": true},
    ignoredDirs: {"node_modules": true},
    scripts: ["echo Hello World"],
};

nitewatch.watch(options);     
```

nitewatch can also be ran from the command line when installed globally
```
nitewatch -y "test" -s "./test.sh" -i "test.js" -d "node_modules" "logs"
```
nitewatch can also be ran on specific files and directories with the watch command
```
nitewatch watch src test.js -d .* node_modules
```

If a .nitewatch.yml is found in the directory when nitewatch is run or a path to a yaml is supplied with the -y option
nitewatch will use the yaml defined options.

## options
nitewatch will ignore files and directories specified in options. Entries can be
file or directory names or patterns.

From the command line:
```
-d, --dirs: list of directories to ignore
-i, --ignore: list of files to ignore
-s, --scripts: list of scripts or commands to run on file change
-y, --yaml: path to yaml file for options
```

Using .nitewatch.yml
```yaml
ignoreFiles:
    - ".eslintrc"
    - ".git"
    - ".gitignore"
    - "*.log"

ignoredDirectories:
    - node_modules
    - .git
    - test

scripts:
    - echo "Hello World!"
```

## License

MIT © Jared Grady

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