Socket
Book a DemoInstallSign in
Socket

shell-task

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shell-task

Proof-of-concept then-able shell commands in node.

Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
43
65.38%
Maintainers
1
Weekly downloads
 
Created
Source

shell-task

Proof-of-concept then-able shell commands in node. (Although it looks like a promise, it is NOT)

Install

$ npm install shell-task

Usage

var Task = require('shell-task')

new Task('git init')
    .then('sleep 1000')
    .then('git add .')
    .then(doSomething)
    .then('git commit -m "testing this cool stuff"')
    .then('git remote add ...')
    .then('git push -u origin master')
    .run(onSuccess, onError)

// you can mix JavaScript functions in between...
function doSomething (next) {
    console.log('doing something...')
    setTimeout(next, 1000)
}

// both onSuccess and onError handlers are optional.
function onSuccess () {
    console.log('done!')
}

// any error or exit code other than 0 will abort task
// and call onError with the exception
function onError (err, next) {
    throw err
    // or you can ignore the exception
    // and just call next(), which will
    // continue the flow
}

Keywords

shell

FAQs

Package last updated on 12 Feb 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