Skip to content

Instantly share code, notes, and snippets.

@sirkitree
Last active August 29, 2015 14:26
Show Gist options
  • Save sirkitree/a9e0288db42211938a2b to your computer and use it in GitHub Desktop.
Save sirkitree/a9e0288db42211938a2b to your computer and use it in GitHub Desktop.
npm watch can run background commands as though they were in the foreground

You can run this command with npm watch and it will run both the watchify command and the gulp watch command in two separate background processes but both process's output will still show up in the foreground. Since they're run through npm, you can hit ctrl+c to cancel the main process which in turn cancels the two background processes.

img

{
"name": "...",
"version": "...",
"scripts": {
"watch": "watchify -o app/bundle.js -v -d app/app.js & gulp watch",
},
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment