M-Zuber / npm-watch

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

Run on new file created #49

Open Dynalon opened 7 years ago

Dynalon commented 7 years ago

[Feature request] It would be nice if the watcher would also trigger when new files are created, that would match a specific pattern.

For example:

package.json

"watch": {
    "copy-assets": "assets/**/*"
},
"scripts": {
   "copy-assets": "cp -R assets/ dist/"
}

That way, if new images are dropped into the assets folder, the would match the pattern and the task would re-run top copy the assets into the dist folder. The current behaviour is, that the newly created file is not picket up by the watcher.

lakb248 commented 7 years ago

+1

dobesv commented 6 years ago

I imagine this would have to be fixed in nodemon, since this tool doesn't do the file watching itself.