I assume you are referring to server side javascript(node.js)
you can use .exec() function in the child_process module . eg
require('child_process').exec('ls',
function (err, stdout, stderr) {
console.log( stdout);
if (err) {
console.log('Error ' + err);
}
});
will run the ls command