appcd-subprocess
v5.0.6
Published
Library for spawning and finding subprocesses.
Downloads
486
Readme
appcd-subprocess
Library for spawning subprocesses.
Visit https://github.com/appcelerator/appc-daemon for more information.
Report issues to GitHub issues. Official issue tracker in JIRA.
Installation
npm i appcd-subprocess
Usage
import { run } from 'appcd-subprocess';
const { stdout, stderr } = await run('ls', ['-la'], { cwd: '/' });
console.log(stdout);
console.log(stderr);
import { spawn } from 'appcd-subprocess';
const child = spawn({
command: process.execPath,
args: [ '--version' ],
options: { cwd: '/' }
});
child.on('close', code => {
console.log(`Process exited: ${code}`);
});
import { which } from 'appcd-subprocess';
const executable = await which('ls');
console.log(`Found it: ${executable}`);
Legal
This project is open source under the Apache Public License v2 and is developed by
Axway, Inc and the community. Please read the LICENSE
file included
in this distribution for more information.