0.2.0 • Published 6 years ago

shell-watcher v0.2.0

Weekly downloads
9
License
ISC
Repository
github
Last release
6 years ago

shell-watcher

This package performs file watching using basic shell commands. You can use the watch.sh script directly, or the exported node functions from index.js.

Implementation

There are 2 versions: http and pipe. The pipe version is simpler, likely more efficient, and has no external dependencies. However, the http version can be manually triggered with a simple curl command if you want to do something out-of-process.

Usage

EXTS=js,json NOTIFY=echo SLEEP=3 ./watch.sh ./some/dir ./some/other
var watch = require('shell-watcher');
watch({
  targets: ['./some/dir',  './some/other'],
  exts: ['js', 'json'],
  sleep: 2
})
var watch = require('shell-watcher');
watch.pipe({
  targets: './some/dir',
  exts: 'js',
  sleep: 2,
  handler: (data) => {
    console.log(data);
  }
})
var watch = require('shell-watcher');
watch.http({
  targets: ['./some/dir',  './some/other'],
  exts: 'js',
  sleep: 2,
  port: 9001
})
0.2.0

6 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago