Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // the old way
- const cp = require('child_process');
- const k = cp.spawn('npm', ['install','lodash']);
- k.stdout.on('data', yourHandlerHere);
- // the more generic way
- const cp = require('child_process');
- const k = cp.spawn('bash');
- k.stdout.on('data', yourHandlerHere);
- k.stdin.write('npm install lodash');
- k.stdin.end('\n');
Add Comment
Please, Sign In to add comment