check-node-version icon indicating copy to clipboard operation
check-node-version copied to clipboard

Expose minversion to callback and expose the package.engines parsing function

Open jasonblalock opened this issue 3 years ago • 1 comments

In your cli functionality you are calculating the min version to satisfy the provided range. It would be nice if you exposed this information to the API callback so I could create my own custom messages without installing another instance of semver. Also avoids any semver version mismatches. E.g. semver.minversion(info.wanted) fails if I use semver v7, as I assume the range object has changed since semver v6 that's used in your package.

Separately providing your package engine parsing function for creating options would also be useful. I've basically had to copy and paste that code as I want that functionality, but again want to provide my own error messages.

jasonblalock avatar Sep 08 '21 08:09 jasonblalock

I'm open to exposing that information in the callback, would you like to send a PR?

Separately providing your package engine parsing function for creating options would also be useful. I've basically had to copy and paste that code as I want that functionality, but again want to provide my own error messages.

Can you elaborate on what part of the logic you're referring to? I think it could make sense to move some of that from cli.js to index.js, or expose it separately. Also open to a PR for that.

parshap avatar Sep 08 '21 17:09 parshap