doowb / watch-cli

Watch files and execute an npm script when files change.
MIT License
60 stars 10 forks source link

Document CLI #1

Closed tomek-he-him closed 9 years ago

tomek-he-him commented 9 years ago

Hi,

thanks for the library – I was looking for this. I can't find any documentation for it though – have I missed something?

doowb commented 9 years ago

@tomekwi I did this a while ago and didn't have documentation ready. I'll get something up soon, but for now the easiest thing to do is install globally: npm i -g watch-cli, then run the watch command from the project folder...

watch -p *.js -c test

This will run npm test when any .js files change in the current directly. I think I'm going to remove the npm part so it'll just run the command directly so there isn't any magic. If you need to add longer command or pattern you can use the full version of the flag and some quotes...

watch --pattern="**/*.js" --command="npm test"

Thanks for reminding me about this project.

doowb commented 9 years ago

Added documentation to readme.