Skip to content

robbtraister/shell-watcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published