A collection of angel abilities.
When used angel.output
and angel.input
will be references to process.stdout
and process.stdin
Does a fancy console.log using angel.cmdData embeded
string
: pattern with{placeholder}
support usingangel.cmdData
as source
Helper methods wrapper of shellreactions-exec
.
All commands support {placeholder}
replacement which uses for data angel.cmdData
commands
: String or Array of commands.next
: optionalfunction(err, result)
, if not present an reactionfunction(angel, next)
will be returned.
angel.cmdData.value = "test"
// with next
angel.exec("echo {value}", function(err, result){
// result == "test"
})
// without next
var fn = angel.exec("echo {value}")
fn(angel, function(err, result){
// result == "test"
})
remote
: String. Its value will be used to get the correspondingangel.cmdData[remote]
value for ssh connection be madecommands
: String or Array of commands.next
: optionalfunction(err, result)
, if not present an reactionfunction(angel, next)
will be returned.
angel.cmdData.value = "test"
angel.cmdData.remoteA = "production"
angel.cmdData.remoteB = "production2"
// with next
angel.ssh("remoteA", "echo {value}", function(err, result){
// result == "test"
})
// without next
var fn = angel.ssh("remoteB", "echo {value}")
fn(angel, function(err, result){
// result == "test"
})
Helper methods wrapper of reactions
.
fnArray
: Array offunction(angel, next)
to be executed in seriesnext
: optional,function(err, result)
, if not present an reactionfunction(angel, next)
will be returned. Note thatresult
will be an Array allfnArray
results.
var reaction = [
function(angel, next) {
next(null, "test")
},
function(angel, next) {
next(null, "test2")
}
]
// with next
angel.series(reaction, function(err, result){
// result[0] == "test", result[1] == "test2"
})
// without next
var fn = angel.series(reaction)
fn(angel, function(err, result){
// result[0] == "test", result[1] == "test2"
})
fn
: any function having callback as last argumentargs
: arguments to be passed tofn
angel.series([ angel.series.wrap(fs.exists, angel.cmdData.value), ... ])
Returns reaction function(angel, next)
wrapped arguments and impl.
src
: String, name of thecmdData
property to be used for sourcedest
: String, name of thecmdaData
property to be used for destinationignoreList
: [ String, matched agains every file ]
Returns reaction function(angel, next)
wrapped arguments and impl.
path
: String, name of thecmdData
property to be used for current directory path
Returns temporary
folder path.
Returns String
where any {placeholder}
are replaced using angel.cmdData as source
https://github.com/vbogdanov/reactions
https://github.com/outbounder/shellreactions-exec
https://github.com/outbounder/organic-angel
https://github.com/mhevery/jasmine-node