Skip to content

avoronkin/f2s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

f2s

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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published