Gem 一覧へ戻る
doowb/watch-cli(新しいタブで開きます)
主要言語: JavaScript
Watch files and execute an npm script when files change.
- star 数
- 60
- watcher 数
- 3
- fork 数
- 10
- issue 数
- 4
- 最終更新
- 2019/11/02
主要言語: JavaScript
Watch files and execute an npm script when files change.
Command line wrapper for gaze to use in package.json scripts object.
Install globally with npm
npm i -g watch-cli
watch -p "**/*.js" -c "npm test"
| Short | Long | Type | Description |
|---|---|---|---|
-p |
--pattern |
string |
glob pattern you are want to watch. |
-c |
--command |
string |
Command to execute on watched files change. |
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
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%"
Brian Woodward
Copyright (c) 2015 Brian Woodward
Released under the MIT license
This file was generated by verb-cli on March 11, 2015.