Conversation
ranyitz
left a comment
There was a problem hiding this comment.
Thanks for taking the time to dive into the codebase and implement this feature!
One thing that I'm not sure about, is whether the Node API should behave like the CLI and return a printed version or return an object instead.
I mean, if someone wants to use this in order to understand what version installed from a script and do something with this information, this person will need to parse the string returned from the function first, which makes it a bit weird.
On the other hand, having this API is better than nothing at the moment. So let's go with it, and we'll implement a non-output version in case it'll be requested.
Regarding the tests, I would re-purpose the already written tests (these for example) to use the external API instead of the internal one.
I already tackled some of the issues there, and I believe it's better to test from the external API if exists.
Simple implementation to a much needed feature, also closes #71