Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/t-ski/watch-build

Generic file watch interface for custom incremental builds.
https://github.com/t-ski/watch-build

file portable watch

Last synced: about 10 hours ago
JSON representation

Generic file watch interface for custom incremental builds.

Awesome Lists containing this project

README

        

# Watch Build

Generic file watch interface for custom incremental builds.

``` cli
npm i t-ski/watch-build
```

### API

``` js
const { Watch } = require("@t-ski/watch-build");

new Watch("./test/", {
filenamePattern: /.*/i,
interval: 1000,
once: false
})
.on("build", (paths) => {
// TODO: Handle changed files passed as argument
}
```

### CLI

``` cli
npx watch [--|- *?]*
```

| | |
| -: | :- |
| **Positional** | **Description** |
| `` `0` | Path to watch file target directory. |
| `` `1`
  | Path to build module with a default function export:
`module.exports = (paths) => {}` |
| **Flag**| **Description** |
| `--once` `-O` | Build once, i.e. without future file change watch. |
| **Option** | **Description** |
| `--interval` `-I` | Time between watch iterations in ms (default: 1000). |
| `--pattern` `-P` | Filename pattern filter (string) regex (default: ".*"). |

##

© Thassilo Martin Schiepanski