1.0.4 • Published 8 years ago

watch-and-exec v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

watch-and-exec

Watch a directory and on any changes, execute the desired command

Build Status version downloads MIT License PRs Welcome

Usage

cli

npm i watch-and-exec -g
watch-and-exec path/to/desired/dir 'command'

background process

You can also use execute the watcher in the background

nohup watch-and-exec path/to/desired/dir 'command' > /dev/null 2>&1 &

local dependency

npm i watch-and-exec -S
const exec = require('child_process').exec;
const dir = 'path/to/directory';
const command = 'some executable';

exec(`./node_modules/.bin/watch-and-exec -d=${dir} -c=${command}`, function(error, stdout, stderr) {
  assert.equal(error, null);
});

background process

Use nohup to execute the watcher as a background process

exec(`nohup ./node_modules/.bin/watch-and-exec -d=${dir} -c=${command} > /dev/null 2>&1 &`, function(error, stdout, stderr) {
  assert.equal(error, null);
});
1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago