Skip to content
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

Adding node api to qnm #72

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Adding node api to qnm #72

wants to merge 6 commits into from

Conversation

deanshub
Copy link

@deanshub deanshub commented Jul 3, 2021

Simple implementation to a much needed feature, also closes #71

Copy link
Owner

@ranyitz ranyitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

find version in node javascript
2 participants