Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @transfast/stream-sorter with all npm packages installed. Try it out:

var streamSorter = require("@transfast/stream-sorter")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@transfast/stream-sorter v0.0.0

Emit sorted stream chunks, buffering the quick ones and discarding the ones that lost the train

Build Status Coverage Status Greenkeeper badge

stream-sorter

Emit sorted stream chunks, buffering the quick ones and discarding the ones that lost the train

Install

npm install stream-sorter

API

consecutive

Emit the data chunks in order, ignoring the old ones

  • options: options passed to underlying Transform stream
    • idField: fields used to store data chunk identifier
    • nextId: initial ID
    • sort: function used to compare and sort the data chunks

latest

Drop data chunks older than the latest emitted one

  • options: options passed to underlying Transform stream
    • idField: fields used to store data chunk identifier
    • lastId: initial ID
    • sort: function used to compare and sort the data chunks

start

Emit the data chunks in bytes order ignoring old ones and allowing intersections

  • options: options passed to underlying Transform stream
    • idField: fields used to store data chunk identifier
    • start: initial ID
    • sort: function used to compare and sort the data chunks
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free