package-add
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

package-add

npm typescript

Programmatically install packages. Supports yarn, npm, and pnpm.

If I should maintain this repo, please ⭐️ GitHub stars

DM me on Twitter if you have questions or suggestions. Twitter Follow


Programmatically install packages. Supports yarn, npm, and pnpm.

Usage

The package manager will be automatically detected:

import install from "package-add";

install("react");

// Equivalent to:
// yarn add react
// npm install react
// pnpm add react

You can also install multiple packages at once:

import install from "package-add";

install(["react", "react-dom"]);

// Equivalent to:
// yarn add react react-dom
// npm install react react-dom
// pnpm add react react-dom

Several options are available as well:

import install from "package-add";

install("lerna", {
  registry: "https://registry.npmjs.org",
  save: "dev",
  ignoreWorkspaceRootCheck: true
});

// Equivalent to:
// yarn add lerna --registry https://registry.npmjs.org --dev --ignore-workspace-root-check
// npm install lerna --registry https://registry.npmjs.org --save-dev --ignore-workspace-root-check
// pnpm add lerna --registry https://registry.npmjs.org --save-dev --ignore-workspace-root-check

Dependenciesdependencies


Dev Dependencies

  • autorepo: Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.

License license

MIT

Package Sidebar

Install

npm i package-add

Weekly Downloads

10

Version

2.0.3

License

MIT

Unpacked Size

7.06 kB

Total Files

8

Last publish

Collaborators

  • bconnorwhite