Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-cmd

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-cmd

An API to execute `npm` commands programmatically.

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29
increased by61.11%
Maintainers
2
Weekly downloads
 
Created
Source

npm-cmd

An API to execute npm commands programmatically.

Installation

npm install --save npm-cmd

Usage

var npm = require('npm-cmd');

npm.install(['express', 'cookie-parser'], {save: true, cwd: '/tmp'}, function(err) {
  if (err) {
    console.log('Installation failed.');
  } else {
    console.log('Installation succeeded!'); 
  }       
});

API

Methods

.install(pkgs, opts, done)

Run npm install where:

  • pkgs is an array of packages to install - optional

  • opts is an object of key-value pairs - optional

  • opts.global whether npm should install

  • opts.save whether npm should save the packages to the dependencies key in package.json

  • opts.saveDev whether npm should save the packages to the devDependencies key in package.json

  • opts.registry the registry which npm should source package information from

  • done is a function called when the command has finished - optional

.dedupe(pkgs, opts, done)

Run npm dedupe where:

  • pkgs is an array of packages to dedupe - optional
  • opts is an object of key-value pairs - optional
  • done is a function called when the command has finished - optional

Options

Global options accepted by all commands:

  • opts.cwd is the directory where the command will be run

Keywords

FAQs

Package last updated on 10 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc