From c6284bd9d8e1ea94c2c9e9f0c4e99a98d298a544 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Wed, 23 Jun 2021 14:10:48 -0400 Subject: [PATCH] RFC: npm pkg --- accepted/0000-npm-pkg.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 accepted/0000-npm-pkg.md diff --git a/accepted/0000-npm-pkg.md b/accepted/0000-npm-pkg.md new file mode 100644 index 000000000..3bdad44cd --- /dev/null +++ b/accepted/0000-npm-pkg.md @@ -0,0 +1,33 @@ +# npm pkg + +## Summary + +A new top-level command that manages any property in your `package.json`. + +## Motivation + +Some users prefer managing their `package.json` using **npm cli** comands rather than manually editing a JSON file. + +As of today, some of the **npm cli** commands already handle the automated management of the `package.json` file, such as `npm install` adding / updating dependency declarations, `npm version` bumping the version value, or in the case of `npm set-script` a top-level command that serves specifically the purpose of managing `"scripts"` data in the `package.json` file. + +## Detailed Explanation + +- Add a `npm pkg` command + +## Rationale and Alternatives + +{{Discuss 2-3 different alternative solutions that were considered. This is required, even if it seems like a stretch. Then explain why this is the best choice out of available ones.}} + +## Implementation + +- Add a new `lib/pkg.js` top-level command that will handle adding / removing / modifying properties in your `package.json` file. + +## Prior Art + +- `npm set-script` top-level command that allow users to add new scripts to their package.json +- `npm init -w ` init command will add the current path to `"workspaces"` property +- `npm install|uninstall ` will add/remove deps to `"dependencies"` + +## Unresolved Questions and Bikeshedding + +- Syntax?