@nodelet/child-process
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

child-process

CircleCI NPM Downloads node License MIT

child-process with rxjs observable interface

Highlights

  • Written in Typescript

  • Observable interface

  • Reactive

Installation

npm:

$ npm install @nodelet/child-process

yarn:

$ yarn add @nodelet/child-process

Usage

child-process with rxjs observable interface

  //spawn
  const { spawn } = require('@nodelet/child-process');

  const childProcess$ = spawn('node', ['-v']);

    let processSubscription = childProcess$.subscribe(
    ({stdout, stderr}) => {
        if(stdout){
            process.stdout.write(stdout)
        } else if(stderr) {
            process.stderr.write(stderr)
        }
    },
    e => console.error(e)
  );

  //exec
  const { exec } = require('@nodelet/child-process');

  const childProcess$ = exec('node -v');

  let processSubscription = childProcess$.subscribe(
    ({stdout, stderr}) => {
        if(stdout){
            process.stdout.write(stdout)
        } else if(stderr) {
            process.stderr.write(stderr)
        }
      },
    e => console.error(e)
  );

License

MIT © Nivrith

Readme

Keywords

Package Sidebar

Install

npm i @nodelet/child-process

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

286 kB

Total Files

13

Last publish

Collaborators

  • nivrith