New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cross-npm-spawn

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-npm-spawn

Cross-platform NPM spawn

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-65%
Maintainers
1
Weekly downloads
 
Created
Source

cross-npm-spawn

Cross-platform NPM spawn

Installation

npm install cross-npm-spawn

Usage

spawnNpm(command, npmArgs, spawnArgs)

Params
  • String command: The npm command (e.g. 'install').
  • Object npmArgs: An object parsed by dargs.
  • Object|String spawnArgs: The spawn options object or just the working directory where to run the command.
Return
  • Promise A promise that if resolved will returns an object with the following properties :
{
  code: Integer,  // Return code of the NPM command. 0 if success, 1 if an error occured
  stdout: String, // stdout of the NPM command
  stderr: String  // stderr of the NPM command
}

Example

const spawnNpm = require('cross-npm-spawn');

// Will execute the "npm show express version" command
const promise = spawnNpm('show', {_: ['express', 'version']}).then((result) => {
  console.log('Return code : ', result.code);
  console.log('Stdout : ', result.stdout);
  console.log('Stderr : ', result.stderr);
}).catch((reason) => {
  console.log('An error occured while executing the NPM command.', reason);
});

Keywords

FAQs

Package last updated on 17 Jun 2016

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