An event based file watching utility.
JavaScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
index.js
package.json
yarn.lock

README.md

NPM Version Build Status

(Y)et (A)nother (W)atch utility. This time event based.

Installation

npm install yaw

Usage

const watcherFactory = require('yaw');
const watcher = watcherFactory();

watcher.watch('some/file/or/directory')
  .on('error', (err) => {
    // Handle error
  })
  .on('create', (filepath, stats) => {
    // Handle new file or directory
  })
  .on('change', (filepath, stats) => {
    // Handle update to file
  })
  .on('delete', (filepath) => {
    // Handle removal of file or directory
  });