-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat(update): add mechanism to allow updating/writing back to package.json
#324
Labels
Comments
References:
Example of what we could do... as a feature
npm update foo --save Current Status/Expectations/Potential
|
ruyadorno
added a commit
to ruyadorno/config
that referenced
this issue
Jan 10, 2022
Add a new method `isDefault(key)` that enables a way to know if the value to be returned by a `config.get(key)` call is coming from the default definitions or any other different source. In case it's coming from the default values this method returns `true`, it returns `false` otherwise. This addition is going to allow for effectively managing different default values in the npm cli on a command-basis, e.g: The `save` config default value in the npm cli is `true`, so that in `npm install` and other commands that value is always going to default to true if no user config is provided. Now let's say we want to use a different value in `npm update`, for example `save=false`. This change enables us to have a conditional check to see if the `save` config value is coming from the default source, thus providing a way to use a different value instead of the default: const save = config.isDefault('save') ? false : config.get('save') Relates to: npm/cli#4223 Relates to: npm/statusboard#324
ruyadorno
added a commit
to npm/config
that referenced
this issue
Jan 10, 2022
Add a new method `isDefault(key)` that enables a way to know if the value to be returned by a `config.get(key)` call is coming from the default definitions or any other different source. In case it's coming from the default values this method returns `true`, it returns `false` otherwise. This addition is going to allow for effectively managing different default values in the npm cli on a command-basis, e.g: The `save` config default value in the npm cli is `true`, so that in `npm install` and other commands that value is always going to default to true if no user config is provided. Now let's say we want to use a different value in `npm update`, for example `save=false`. This change enables us to have a conditional check to see if the `save` config value is coming from the default source, thus providing a way to use a different value instead of the default: const save = config.isDefault('save') ? false : config.get('save') Relates to: npm/cli#4223 Relates to: npm/statusboard#324
Landed in npm/cli#4223 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem Statement
We've experience significant feedback from users that they were using the
npm update
command to reflect changes inpackage.json
; Rightly or wrongly, this seems to be a pattern which is useful for some & we should facilitate a mechanism for them to achieve this in v7The text was updated successfully, but these errors were encountered: