Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

co-sh

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

co-sh

Call any program as if it were a function

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

sh

Using Proxies & Generators to run shell commands.

Uses node v0.11.x with --harmony-proxies --harmony-generators flags, along with

  • co
  • thunkify
  • co-read

Install

Use n to install node v0.11.x

n 0.11.13

Usage

var co = require('co');
var read = require('co-read');
var sh = require('co-sh');

co(function *(){
  var ls = yield sh.ls();

  var buf;
  while (buf = yield read(tail.stdout)) {
    console.log(buf.toString());
  }

  try {
    yield sh.nonexistingcmd();
  } catch(e){
  }
})();

Assuming the above code is in a file called test.js run it using;

node --harmony-proxies --harmony--generators test.js

See the examples folder for more

LICENCE

MIT

Keywords

FAQs

Package last updated on 11 Jun 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc