-
Notifications
You must be signed in to change notification settings - Fork 511
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
[FEATURE] Allow piping into semver to read version #149
Comments
I'm ok with it. Patch welcome, as long as it includes docs and test :) |
Great. Is it possible to "detect" if there is data being piped from stdin or is a new command line flag needed? |
You can check process.stdin.isTTY and also default to stdin if - is an option or if no options are provided. The stdin stream should be a white space delimited set of versions, probably? |
thanks.
I agree. There is no engine field in package.json. What node versions have to be supported? I guess no arrow functions? |
I guess the whitespace splitting will not work completely because one version can contain spaces, like |
@felixfbecker Those are version ranges, not versions. I'm imagining a thing like this: get-list-of-versions-somehow | semver -r '>=2' > file-with-versions-gt-two.txt So, the list of versions can be piped to stdin, but not the set of ranges |
can we merge this? |
It would be very nice if we could do this:
node -v | semver -r ^5.4
Of course one could do
semver $(node -v)
but that only works in sh and not on Windows, which makes it bad for npm scripts.The text was updated successfully, but these errors were encountered: