-
Notifications
You must be signed in to change notification settings - Fork 3k
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: npm pkg get <value> --raw #5508
Comments
Seems reasonable to me - you may want to file an RFC. |
@ljharb sure - but I don't know what is this. Do you have an example? |
Do you mean I'd better create it here? https://github.com/npm/rfcs/issues |
Just did: npm/rfcs#634 |
From the linked RFC (npm/rfcs#634), this is a great feature enhancement (and something I would use personally 😄). If anyone wants to implement it, the flag should be |
As the default value for the |
Hi! I'm really wondering will any of flags ( --raw, --parseable, --json ) be considered to print version without quotes? Thanks! |
Problem
One of the most popular use cases for
pkg get
command is getting values for other scripts as variables. However currently it's returning the value with quotes:The current solution is to use it in a pipe and remove quotes somehow with sed or jq. It's ok, but this solution si not cross-platform or requires additional packages installation.
Suggestion
To introduce --raw/-r flag for npm pkg get command
Thus, for the following command we will expect the raw value:
What do you think? It's a simple case but you can see how much discussion about this topic:
https://gist.github.com/DarrenN/8c6a5b969481725a4413
https://stackoverflow.com/questions/9153571/is-there-a-way-to-get-version-from-package-json-in-nodejs-code
The text was updated successfully, but these errors were encountered: