sort-stream2
v1.0.0
Published
Array.prototype.sort for streams
Downloads
110
Readme
sort-stream2
Array.prototype.sort for streams, a refresh of @domenictarr's sort-stream.
Example
var sort = require("sort-stream2")
var through = require("through2")
var objs = through.obj()
objs.write({id: 3})
objs.write({id: 2})
objs.write({id: 1})
objs.end()
objs
.pipe(sort(function(a, b){ return a.id - b.id }))
.on("data", console.log)
// {id: 1}
// {id: 2}
// {id: 3}