continuable-list

Turn an array of continuables into a continuable containing an array

npm install continuable-list
2 downloads in the last day
22 downloads in the last week
80 downloads in the last month

continuable-list

Turn an array of continuables into a continuable containing an array

Example

var list = require("continuable-list")
var fs = require("fs")

var readFile = function (uri) {
    return function continuable(cb) {
        fs.readFile(uri, cb)
    }
}

var uris = ["./package.json", "./index.js", "./README.md"]

var files = uris.map(function (uri) {
    return readFile(uri)
})

list(files)(function (err, files) {
    // now have an array of buffers or an error if one of
    // the read requests failed
})

Installation

npm install continuable-list

Contributors

  • Raynos

MIT Licenced

npm loves you