New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command line interface #284
Conversation
But anyway, I think the binary is out of scope for chokidar, an NPM interface. I would suggest to create your own NPM package that'll do the same thing. Maybe name it as Another reason for this is that some folks would want slightly different CLI. E.g. stream list of changed files instead of re-running the command. |
Thanks for the contribution @kimmobrunfeldt, but I agree with @paulmillr that this belongs in a separate package. Just as a side note, we try to minimize the dependencies in chokidar, so even if we wanted to merge this feature would have needed to be changed to drop the convenience features of the lodash and bluebird utility libs. Minimatch was added without being used, and chokidar uses anymatch for glob matching anyway. I would have been ok with keeping yargs or an alternate argument parsing lib to support this feature though. Also It's worth noting there are some existing CLI wrappers for chokidar on npm already https://www.npmjs.com/package/onchange @paulmillr if we're going to mention this in the readme we should pick one favorite. Probably the first one. What do you think? |
Let's use the first one. |
I created a new cli which supports quite a lot of options: https://github.com/kimmobrunfeldt/chokidar-cli |
It is not fully ready yet but will be in the following few days. I'm going to use it my self in my other projects so I'll keep maintaining it. |
@paulmillr @es128 chokidar-cli is now "ready". https://www.npmjs.com/package/chokidar-cli I renamed the binary to |
I added support for piping/change streaming and moved "run command on change" under optional |
@kimmobrunfeldt sounds good. I'm warming up to the idea of recommending your tool in the README. I think it would be cool if you could add @paulmillr and I as collabs on the repo & npm. |
@es128 sure, done. |
Add cli too named
watch
. Argument parsing done with yargs. Adds a few dependencies.