Skip to content
forked from doowb/watch-cli

Watch files and execute an npm script when files change.

License

Notifications You must be signed in to change notification settings

1000i100/watch-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watch-cli-only NPM version

Command line wrapper for gaze to use in package.json scripts object.

chokidar-cli do the same and is widely used.

Install globally

Install globally with npm

npm i -g watch-cli-only

Usage

watch -p "**/*.js" -c "npm test"

Options

Short Long Type Description
-p --pattern string glob pattern you are want to watch.
-c --command string Command to execute on watched files change.

Multi Patterns

It is possible to provide multi paterns, so if one of the files changed, the command will execute.

watch -p file1.js -p file2.fs -c command

Exported environment variables

Environment variables available from the command string:

FILENAME           Relative filename.
ABSOLUTE_FILENAME  Asolute filename.
EVENT              Event type. Is either 'changed', 'deleted' or 'added'.

Use it like this in Linux/macOS:

$ watch -p '**/*.js' -c 'jshint $FILENAME'

In Windows:

> watch -p "**/*.js" -c "jshint %FILENAME%"

Original Author

Brian Woodward

New Maintainer

From the old watch-cli version to the new watch-cli-only

Millicent Billette

1forma-tic.fr

License

Copyright (c) 2015 Brian Woodward
Released under the MIT license

About

Watch files and execute an npm script when files change.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%