Socket
Socket
Sign inDemoInstall

exec.it

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    exec.it

Quick example of using Process.exec


Version published
Weekly downloads
2
Maintainers
1
Install size
3.56 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 20 Jan 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc