kolla

0.0.8 • Public • Published

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')

Package Sidebar

Install

npm i kolla

Weekly Downloads

1

Version

0.0.8

License

MIT

Last publish

Collaborators

  • benjick