Socket
Book a DemoInstallSign in
Socket

@ahmadnassri/spawn-promise

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ahmadnassri/spawn-promise

Child Process Spawn as a Promise, with simple in/out piping

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
60
-25.93%
Maintainers
1
Weekly downloads
 
Created
Source

Spawn Promise version License

Child Process Spawn as a Promise, with simple in/out piping

Build Status Downloads Code Climate Coverage Status Dependency Status Dependencies

Install

npm install --only=production --save @ahmadnassri/spawn-promise

API

spawn (command [, args] [, options] [, input])

identical to child_process.spawn in every way, except:

  • writes the input value to stdin,
  • on success returns a Promise that is fulfilled with a simple object containing both stdin & stdout buffers.
  • on failure returns a Promise rejected with a SpawnError error object containing both stdin & stdout buffers.

Usage

import Spawn from '@ahmadnassri/spawn-promise';

const options = {
  env: process.env 
}

// success
spawn('grep', ['f'], options, 'foo')
    .then(streams => console.log(streams.stdout))

:copyright: ahmadnassri.com  ·  License: ISC  ·  Github: @ahmadnassri  ·  Twitter: @ahmadnassri

Keywords

spawn

FAQs

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