You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: type package manager install and uninstall options
Replace the untyped npm flag bag passed to install/uninstall with
IPackageInstallOptions and IPackageUninstallOptions (save, dev, optional,
exact, silent, ignoreScripts plus the CLI-internal options). Each package
manager declares how it spells each option, and options a manager has no
flag for are dropped instead of leaking npm syntax onto its command line.
This fixes yarn berry receiving --save-dev / --save-exact (silently
dropped, so platforms landed in dependencies) and --ignore-scripts (an
unknown option that aborted the install); it now gets --dev, --exact and
--mode=skip-build. bun receives its own --dev / --exact instead of npm's.
Also settle the implementation class names on NpmPackageManager,
YarnPackageManager, Yarn2PackageManager, PnpmPackageManager and
BunPackageManager.
`npm` module provides a way to interact with npm specifically the use of install, uninstall, search and view commands.
480
480
481
481
### install
482
-
Installs specified package. Note that you can use the third argument in order to pass different options to the installation like `ignore-scripts`, `save` or `save-exact` which work exactly like they would if you would execute npm from the command line and pass them as `--` flags.
482
+
Installs specified package. The third argument takes package-manager-agnostic options (`dev`, `exact`, `save`, `optional`, `silent`, `ignoreScripts`); the selected package manager maps them onto its own command line flags.
483
483
* Auxiliary interfaces:
484
484
```TypeScript
485
485
/**
@@ -533,11 +533,11 @@ Uninstalls a specified package.
533
533
/**
534
534
* Uninstalls a dependency
535
535
* @param{string}packageName The name of the dependency.
536
-
* @param{IDictionary<string | boolean>}configAdditional options that can be passed to manipulate uninstallation.
0 commit comments