scramjet-fini
TypeScript icon, indicating that this package has built-in type declarations

1.3.59 • Public • Published

Scramjet Infinite Stream

A readable stream and a Scramjet plugin that never ends and always returns consequent id's.

Installation

npm install scramjet-fini

Usage as a plugin

You can use this module as a scramjet plugin - it will add a new method to all the streams: addId

    const scramjet = require('scramjet')
        .plugin(require("scramjet-fini"));

    fs.createReadStream("mydata.log")
        .pipe(new scramjet.StringStream())
        .split("\n")
        .parse(logParser)
        .addId((logline, id) => logline.id = id)

All the logs in the above example will have a sequential id.

Usage as Readable stream

    const {InfinteDataStream} = require("scramjet-infinite");

    new InfiniteDataStream()
        .pipe(myStream);

Oh... if you think of piping this to disk - this actually never ends and it will eventually use all your disk space.

Readme

Keywords

none

Package Sidebar

Install

npm i scramjet-fini

Weekly Downloads

1

Version

1.3.59

License

MIT

Unpacked Size

5.62 kB

Total Files

10

Last publish

Collaborators

  • patu
  • scramjetorg
  • michalcz
  • stoq