Advertisement
alseambusher

Correct exec with env

Sep 15th, 2016
9,507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // make a clone of process.env, you wouldn't wanna mess around with the original
  2. let env = Object.assign({}, process.env, {MY_ENV1: 'value', MY_ENV2: 'value2'});
  3. child_process.exec("command", {env: env}, (error, stdout, stderr) => {});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement