Skip to content

Adding node api to qnm#72

Open
deanshub wants to merge 6 commits intoranyitz:masterfrom
deanshub:node-api
Open

Adding node api to qnm#72
deanshub wants to merge 6 commits intoranyitz:masterfrom
deanshub:node-api

Conversation

@deanshub
Copy link
Copy Markdown

@deanshub deanshub commented Jul 3, 2021

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

Copy link
Copy Markdown
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