sort-stream2

1.0.0 • Public • Published

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}

Readme

Keywords

none

Package Sidebar

Install

npm i sort-stream2

Weekly Downloads

16

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jed