continuable-list
v0.1.6
Published
Turn an array of continuables into a continuable containing an array
Downloads
594
Readme
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