🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

ezspawn

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ezspawn

Spawn a process with ease.

1.1.0
latest
Source
npm
Version published
Weekly downloads
18
125%
Maintainers
1
Weekly downloads
 
Created
Source

ezspawn Build Status

Spawn a process with ease.

Install

npm install --save ezspawn

Usage

var ezspawn = require('ezspawn');

ezspawn('ls -lh').then(function(output) {
  console.log(output);
});

API

ezspawn.spawn(cmd)

Spawn a process and return the child_process object.

ezspawn(cmd, timeout=60000)

Runs cmd, and returns a promise with the results.

cmd

The command you wish to execute. It uses cli-command-parser to parse the string into a suitable format for child_process#spawn.

waitForProcess

When true, ezspawn will capture stdout, stderr and wait for the process to terminate. The returned promise will be resolved to an object containing the following:

{
  code: exitCode,
  stdout: stdoutBuffer,
  stderr: stderrBuffer
};

When false, the promise will be resolved with the return value of child_process#spawn.

Default: true

timeout

Specifies how long we should wait for the process in milliseconds before timing out.

Default: 60 seconds

Keywords

spawn

FAQs

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