var assert = require('assert')
var f2s = require('f2s')
var stream = require('stream')
var transformStream = f2s([
function (doc, cb) {
doc.cb = true
cb(null, doc)
},
function (doc) {
return Promise.resolve()
.then(function () {
doc.promise = true
return doc
})
},
function (doc) {
doc.sync = true
return doc
}
])
var readable = new stream.Readable({
objectMode: true
})
readable
.pipe(transformStream)
.on('data', function (data) {
assert(data.cb)
assert(data.promise)
assert(data.sync)
})
readable.push({key:'value1'})
readable.push({key:'value2'})
readable.push(null)
-
Notifications
You must be signed in to change notification settings - Fork 0
avoronkin/f2s
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published