Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "npm-watch", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "run scripts from package.json when files change", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,3 @@ # npm-watch | ||
If you need to watch files with extensions other than those that `nodemon` watches [by default](https://github.com/remy/nodemon#specifying-extension-watch-list) (`.js`, `.coffee`, `.litcoffee`), you can set the value to an object with `patterns` and `extensions` keys. You can also add an `ignore` key (a list or a string) to ignore specific files. | ||
If you need to watch files with extensions other than those that `nodemon` watches [by default](https://github.com/remy/nodemon#specifying-extension-watch-list) (`.js`, `.coffee`, `.litcoffee`), you can set the value to an object with `patterns` and `extensions` keys. You can also add an `ignore` key (a list or a string) to ignore specific files. Finally, you can add a `quiet` flag to hide the script name in any output on stdout or stderr. | ||
@@ -38,3 +38,4 @@ ```javascript | ||
"extensions": "js,jsx", | ||
"ignore": "src/vendor/external.min.js" | ||
"ignore": "src/vendor/external.min.js", | ||
"quiet": "true" | ||
} | ||
@@ -41,0 +42,0 @@ }, |
@@ -47,2 +47,3 @@ 'use strict'; | ||
var ignores = null | ||
var quiet = null | ||
@@ -53,2 +54,3 @@ if (typeof pkg.watch[script] === 'object' && !Array.isArray(pkg.watch[script])) { | ||
ignores = pkg.watch[script].ignore | ||
quiet = pkg.watch[script].quiet | ||
} else { | ||
@@ -81,4 +83,9 @@ patterns = pkg.watch[script] | ||
}) | ||
proc.stdout.pipe(prefixer('[' + script + ']')).pipe(stdin.stdout) | ||
proc.stderr.pipe(prefixer('[' + script + ']')).pipe(stdin.stderr) | ||
if (quiet === 'true') { | ||
proc.stdout.pipe(stdin.stdout) | ||
proc.stderr.pipe(stdin.stderr) | ||
} else { | ||
proc.stdout.pipe(prefixer('[' + script + ']')).pipe(stdin.stdout) | ||
proc.stderr.pipe(prefixer('[' + script + ']')).pipe(stdin.stderr) | ||
} | ||
}) | ||
@@ -85,0 +92,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8522
105
95