Neural Processing Mechanisms
Join us to discuss the challenges, solutions and best practices for in-house JavaScript code sharing. Tuesday, 12/17 at 10am PT/1pm ET.Sign up here »

stream-orderby

0.0.2 • Public • Published

stream-orderby

orderby for stream json objects on nodejs

example:

stream.pipe API

generator(5).pipe(orderBy([
  {
    keys: 'grade.name,value',
    reverse: true
  }, {
    getValue: function(doc) {
      return doc.age;
    },
    reverse: false
  }, 'name'
])).on('data', function(doc) {
  return console.log(doc);
}).once('end', function() {
  console.log("order by end.");
});
 

if you read array object to order by,you can use event-stream readArray

Install

npm i stream-orderby

DownloadsWeekly Downloads

1

Version

0.0.2

License

ISC

Last publish

Collaborators

  • avatar