1.5.0 • Published 7 years ago

f2s v1.5.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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)
1.5.0

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.0.0

7 years ago