exec.it

0.0.1 • Public • Published

exec.it

This is a quick example of using process.exec to execute a shell command. It can be included as a module if you so desire, but it's more just a reminder how to do it.

The Code

Here's how you do it yourself...

require("child_process").exec(command,options,function(err,stdout,stderr){
	// do something here with stdout/stderr
});

Usage as module

If you would prefer you can use exec.it as a module, this:

var execit = require("exec.it");
execit("ls -la",function(err,stdout,stderr){
	console.log("stdout: "+stdout);
	console.log("stderr: "+stderr);
});

Why?

Because I had five minutes.

Readme

Keywords

none

Package Sidebar

Install

npm i exec.it

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • arei