Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. child = child_process.spawn(cmd, args);
  2.  
  3. child.stdout.on('data', (chunk) => {
  4. res.write(chunk);
  5. });
  6.  
  7. child.on('error', function(err) {
  8. res.status(500).json({...});
  9. });
  10.  
  11. child.on('close', (code) => {
  12. res.end();
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement