-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add functions to update a package.json
file, target Node.js 16, bump deps
#21
Add functions to update a package.json
file, target Node.js 16, bump deps
#21
Conversation
Looks good to me.
I think it would be nice if it created. It should be clearly documented though. If someone actually wants it to throw, it could be added as an option later.
Some more ideas (you may have them already, didn't look too close):
|
updatePackage
, target Node.js 16, bump deps
Updated per #13 (comment). Still need to update the readme. Should probably add a note that |
@sindresorhus that should be everything. There may be some inconsistencies between the readme and the descriptions in |
updatePackage
, target Node.js 16, bump depspackage.json
file, target Node.js 16, bump deps
|
||
### addPackageDependencies(path?, dependencies, options?) | ||
|
||
Returns a `Promise` that resolves when the `package.json` file has been written. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to include the code examples from the TS types for each of these methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
Thanks :) |
@sindresorhus just noticed I didn’t add the |
|
Closes #13. Bumps dependencies / Node.js version (and adds Node.js 18/20 to CI), and adds new functions for updating a
package.json
file. Source/test files have been separated by function.updatePackage, updatePackageSync
Updates/creates a
package.json
file. Usesdeepmerge-ts
to merge properties.addPackageDependences, addPackageDependencesSync
Adds dependencies to a
package.json
file. UsesupdatePackage
internally, so it will create apackage.json
file if one doesn't exist.removePackageDependences, removePackageDependencesSync
Removes dependencies from a
package.json
file. If thepackage.json
file doesn't exist, it does not throw.