0.0.8 • Published 9 years ago
kolla v0.0.8
kolla.js 👀
Watch files and trigger actions. Uses chokidar to watch the filesystem.
Install
npm install --save-dev kolla
Usage
CLI
kolla
takes two arguments. The first one is a glob, file or dir. The second one is the command to be executed on file change. If you put a :
before the command it will execute the npm script with the same name.
Example
package.json
"scripts": {
"lint": "eslint .",
"lint:watch": "kolla '**/*.js' :lint",
"test:elm": "elm-test test/TestRunner.elm",
"test:elm:watch": "kolla '**/*.elm' :test:elm",
"crazy": "kolla '**/*' 'echo hello!'"
}
API
watcher() takes the same two arguments as the CLI. Doesn't return anything so might not be useful.
Example
import watcher from 'kolla';
watcher('**/*.js', ':lint')