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

exec-npm

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exec-npm

Executes npm commands within a child_process fork in order to prevent npm to take too much memory

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

exec-npm

Executes npm within a child_process fork in order to prevent npm to take too much memory in the current one.
This module has been created to free the Kevoree Node.js runtime from npm's heavy memory usage.

Installation

npm i exec-npm --save

Usage

var execNpm = require('exec-npm');

// arguments to give to npm client
// this is equivalent to a call to:
//  $ cd /where/to/install/modules
//  $ npm install minimist async express
var cmd = [ 'install', 'minimist', 'async', 'express', '--prefix=/where/to/install/modules' ];

execNpm(cmd, function (err) {
  if (err) {
    console.log('Something went wrong: '+err.message);
  } else {
    console.log('Success');
  }
});

NB. When you specify a prefix, npm will always append to it the node_modules folder.

API

execNpm(args, options, callback): Function

  • args: Array - command-line arguments to give to the npm client (see npm's help)
  • options (optional): Object - child_process fork options
  • callback: Function - a function to be called when the process is done (first parameter is the error, if any)

Keywords

FAQs

Package last updated on 03 Nov 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