JoeCroqueta

Node.JS

Jul 19th, 2011
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //////////////////////////////////////////////////////////////////////////////////////////
  2. // Ejecutar un proceso desde NodeJS
  3. // http://nodejs.org/docs/v0.5.1/api/child_processes.html
  4.  
  5. var sys = require('sys')
  6. var exec = require('child_process').exec;
  7. var child;
  8.  
  9. child = exec("pwd", function (error, stdout, stderr) {
  10.   sys.print('stdout: ' + stdout);
  11.   sys.print('stderr: ' + stderr);
  12.   if (error !== null) {
  13.     console.log('exec error: ' + error);
  14.   }
  15. });
Advertisement
Add Comment
Please, Sign In to add comment