Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including add-pkg with all npm packages installed. Try it out:

var addPkg = require("add-pkg")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

add-pkg v1.0.1

Install the package with your package manager

img

What's this?

add-pkg provides some package manager installation commands in one command. ♨︎

For example, you can write in one line how to install your package.

🙄 Before:

npm install <your-package> # npm
yarn add <your-package> # yarn
# another command...

✨ After:

npx add-pkg <your-package>

Supporting package managers

Isn't your favorited package manager listed here? Please create issue/PR here! 😆

Usage

Install to dependencies

npx add-pkg <your-package>

Install to devDependencies

  • -d or -D or --dev
npx add-pkg <your-package> -d

Install to global

  • -g or -G or --global
npx add-pkg <your-package> -g

Run dry-run

Check the command to be executed

npx add-pkg <your-package> --dry-run

Priority of the package manager

  1. A package manager that is installed and also has a lockfile
  2. Installed package manager (npm excluded)
  3. npm

License

  • code: MIT
  • icon: Icon made by Freepik from www.flaticon.com
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free