NodeJS child_process fork and spawn as rxjs6+ observables.
npm install --save rxjs-child-process
// Or
yarn add rxjs-child-process
const { spawnObservable } = require('rxjs-child-process');
// Or
import { spawnObservable } from 'rxjs-child-process';
spawnObservable('rm', ['-rf', '/var']).subscribe(
msg => console.log(msg),
err => console.err(err),
);
const { forkObservable } = require('rxjs-child-process');
// Or
import { forkObservable } from 'rxjs-child-process';
forkObservable('./script.js', ['--path', './some/path']).subscribe(
msg => console.log(msg),
err => console.err(err),
);