Socket
Socket
Sign inDemoInstall

exec-simple

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    exec-simple

runs a process as a promise


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
367 kB
Created
Weekly downloads
 

Readme

Source

ExecSimple

A simple command runner in nodejs. This is a port of exec-simple for ruby for nodejs.

Usage

A simple execution:

var ExecSimple = require('exec-simple');
var es = new ExecSimple('echo test');
es.run().then(function (code) {
    console.log('done');
});

Handle timeouts:

var es = new ExecSimple('echo "Sleep... wait for it"; sleep 100; echo "DARY"');
es.run().timeout(50).then(function (code) {
    console.log('done');
}).catch (function (code) {
    console.log('process took too long');
});

Recieve stdout and stderr events

var es = new ExecSimple('echo test');
es.on('control', function (data) {
    console.log(data);
});
es.on('stderr', function (data) {
    console.log(data);
});
es.on('stdout', function (data) {
    console.log(data);
});

es.run()

Installation

npm install exec-simple

Contributing

  1. Fork it ( http://github.com//exec-simple/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT

Keywords

FAQs

Last updated on 12 May 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