Socket
Book a DemoInstallSign in
Socket

scramjet-fini

Package Overview
Dependencies
Maintainers
3
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scramjet-fini

A scramjet compatible readable stream that never ends

latest
Source
npmnpm
Version
1.3.59
Version published
Weekly downloads
35
600%
Maintainers
3
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 10 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts