Skip to content
Install an npm package
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

npm-install-package

NPM version build status Test coverage Downloads js-standard-style

Install an npm package.

Installation

$ npm install npm-install-package

Usage

var install = require('npm-install-package')

install('minimist', function (err) {
  if (err) throw err
})

With multiple installs, offline-first fetching and saving to dev dependencies:

var install = require('npm-install-package')

var devDeps = [ 'map-limit', 'minimist', 'cliclopts' ]
var opts = { saveDev: true, cache: true }

install(devDeps, opts, function (err) {
  if (err) throw err
})

API

install(dependencies, options, cb)

Install an array of dependencies. Opts can contain the following values:

  • save: save a value to dependencies. Defaults to false
  • saveDev: save a value to devDependencies. Defaults to false
  • cache: attempt to get packages from the local cache first. Defaults to false
  • silent: install packages silently without writing to stdout. Defaults to false

License

MIT

You can’t perform that action at this time.