SHARE
TWEET

Untitled

a guest May 19th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async function execProcess(command, input) {
  2.     const options = { timeout: 5000, maxBuffer: 50 * 1024 * 1024 };
  3.  
  4.     return new Promise((resolve, reject) => {
  5.         const proc = child_process.exec(command, options, (error, stdout, stderr) => {
  6.             resolve({ stdout, stderr });
  7.         });
  8.  
  9.         if (input) {
  10.             proc.stdin.write(input, () => {
  11.                 proc.stdin.end();
  12.             });
  13.         }
  14.     });
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top