Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

jed/sort-stream2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sort-stream2

Build Status

Array.prototype.sort for streams, a refresh of @dominictarr's sort-stream. Use carefully, as sorting requires the whole stream to be buffered.

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}

About

Array.prototype.sort for streams

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published