@nodelet/child-process
v1.1.0
Published
child-process with rxjs observable interface
Downloads
2
Readme
child-process
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