M-Zuber / npm-watch

run npm scripts when files change
MIT License
323 stars 38 forks source link

Quiet [nodemon] #51

Closed axelpale closed 3 years ago

axelpale commented 6 years ago

It is possible to hide [taskname] prefix with quiet: true. Is it possible to hide rows that have [nodemon]?

axelpale commented 6 years ago

A solution is to use grep. I added this line to my package.json:

"watch": "npm-watch | grep --invert-match nodemon"

Works at least on macOS Sierra. Can somebody confirm on Linux?

niklasmh commented 6 years ago

@axelpale Works like a charm on Ubuntu!

MaffooBristol commented 6 years ago

Didn't work for me, or at least if I specify which task to run.

npm run watch test

npm-watch | grep --invert-match nodemon "test"

grep: test: No such file or directory events.js:163 throw er; // Unhandled 'error' event ^

Error: write EPIPE at exports._errnoException (util.js:1050:11) at WriteWrap.afterWrite [as oncomplete] (net.js:813:14)

leviwheatcroft commented 5 years ago

In my case I was getting spammed with hundreds of lines like:

[nodemon] files triggering change check: build/stats/graph.csv
[nodemon] changes after filters (before/after): 1/0

Turns out I had a global nodemon.json with "verbose": true, solution was to add this to repo package.json:

  "nodemonConfig": {
    "verbose": false
  }

This won't work for the other minimal starting / watching output nodemon provides.

M-Zuber commented 3 years ago

My apologies, this has been out for a while. You can set silent in the config for a script, and it will hide all nodemon output

"echo": {
    "patterns": "index.js",
    "silent": true,
    "ignore": [
        "*.foo.js"
    ]
},