Open alansouzati opened 8 years ago
FYI, I know we could use NPM itself to handle that, but as you can see here, it is kind of weird the way they do it:
http://stackoverflow.com/questions/10972176/find-the-version-of-an-installed-npm-package
Hey thanks!
That's a good idea. You should write and publish Vorpal extension that does that - I think people would find that very useful! You could call it vorpal-version
. It would be implemented like this:
const vorpal = new Vorpal();
vorpal.use(require('vorpal-version')
.show();
This would simply run the above code sample you wrote and inject a new version
command into Vorpal.
Here are the docs on writing extensions, and here are some sample extensions.
Let me know if you need any help!
Thanks, i think i got it. i will write a PR for that early next week.
Currently I have a built-in node CLI for Grommet.
I'm in the process of investigating a framework to handle the CLI for me. I've compared multiple frameworks and yours is the one I liked the most API-wise. Good job!
Our CLI today has a
grommet --version
. I was wondering if you have something similar that would output the version of the CLI. For now, this is what I did, but I believe this task is generic enough that could be added be default as we havehelp
andexit
.I would be happy to create a PR if you think that this is useful.