angelabilities

A collection of angel abilities.

angelabilities

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 using angel.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 : optional function(err, result), if not present an reaction function(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 corresponding angel.cmdData[remote] value for ssh connection be made
  • commands : String or Array of commands.
  • next : optional function(err, result), if not present an reaction function(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 of function(angel, next) to be executed in series
  • next : optional, function(err, result), if not present an reaction function(angel, next) will be returned. Note that result will be an Array all fnArray 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 argument
  • args : arguments to be passed to fn


angel.series([ angel.series.wrap(fs.exists, angel.cmdData.value), ... ])

Returns reaction function(angel, next) wrapped arguments and impl.

  • src : String, name of the cmdData property to be used for source
  • dest : String, name of the cmdaData property to be used for destination
  • ignoreList : [ String, matched agains every file ]

Returns reaction function(angel, next) wrapped arguments and impl.

  • path: String, name of the cmdData property to be used for current directory path

Returns temporary folder path.

Returns String where any {placeholder} are replaced using angel.cmdData as source

Thanks to

https://github.com/vbogdanov/reactions

http://underscorejs.org

https://github.com/outbounder/shellreactions-exec

https://github.com/outbounder/organic-angel

https://github.com/mhevery/jasmine-node

https://github.com/AvianFlu/ncp

http://github.com/vesln/temporary