New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

spawn-process

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

spawn-process

Promise wrapper for `child_process.spawn`

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
40
-20%
Maintainers
1
Weekly downloads
 
Created
Source

spawn-process npm version build status coverage status

Promise wrapper for child_process.spawn.

Installation

npm install spawn-process

Usage

spawnProcess will resolve with the stdout output or reject with the stderr.

import spawnProcess from 'spawn-process';

(async () => {
    const stdout = await spawnProcess('echo', ['Hello world']);
    console.log(stdout);
})();

With spawn options

You can pass any options from child_process.spawn, for example piping inputs and outputs:

import spawnProcess from 'spawn-process';

(async () => {
    await spawnProcess('echo', ['Hello world'], {
        stdio: [process.stdin, process.stdout, process.stderr],
    });
})();

With CommonJS / require()

const spawnProcess = require('spawn-process');
spawnProcess('echo', ['Hello world']).then((stdout) => {
    console.log(stdout);
});

FAQs

Package last updated on 09 Aug 2024

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