Skip to content

Instantly share code, notes, and snippets.

@ybouhjira
Created February 1, 2014 03:02
Show Gist options
  • Save ybouhjira/8747362 to your computer and use it in GitHub Desktop.
Save ybouhjira/8747362 to your computer and use it in GitHub Desktop.
This is how you call a command from node.js
var exec = require('child_process').exec;
var options = {
cwd : '/'
};
exec('ls', options, function ls_function(error, stdout, stderr){
console.log("ls : \n" + stdout);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment