Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function execProcess(command, input) {
- const options = { timeout: 5000, maxBuffer: 50 * 1024 * 1024 };
- return new Promise((resolve, reject) => {
- const proc = child_process.exec(command, options, (error, stdout, stderr) => {
- resolve({ stdout, stderr });
- });
- if (input) {
- proc.stdin.write(input, () => {
- proc.stdin.end();
- });
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement