1.0.0 • Published 9 years ago

sort-stream2 v1.0.0

Weekly downloads
40
License
MIT
Repository
github
Last release
9 years ago

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}