M-Zuber / npm-watch

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

Enhancement - runOnStartupOnly #66

Closed ca0v closed 3 years ago

ca0v commented 5 years ago

npm-watch has the neat effect of running scripts in parallel and a runOnStartupOnly option might be useful to tell npm-watch to run a batch of scripts once and then terminate (like npm-run-all).

M-Zuber commented 5 years ago

I am not so sure if this is in scope for this project. It's point is specifically to provide the ability to watch and re-run scripts.

That said, I will leave this open a bit as I think it over, and to see if anyone else has feedback.

songoo commented 5 years ago

Hello, on my local develop machine "npm run watch" is great. But on server where I do releases, how can i make an command "npm run watch once" or something so it does not keep running in background ?

Gyunikuchan commented 4 years ago

This hack works for me

"watch": {
  "watcher-initialize": {
    "patterns": [
      "only-run-once.please"
    ]
  }
}
M-Zuber commented 3 years ago

Since there is a workaround, and the feature is out of scope for this project, I am closing the issue.