Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stream-storage

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-storage

Node duplex buffer stream for caching data.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Node stream storage

Version npm

Simple duplex streams for cache large data in memory and files.

Installing

npm install stream-storage

Usage

import { StreamStorage } from 'stream-storage';
const streamStorage = new StreamStorage();
// using ...
streamStorage.clear();

stream-storage

StreamStorage extends the standard stream.Duplex interface. All writes data to this stream will accumulate in internal Buffers. Data exceeding the maxMemorySize of the size will be saved to a file.

You can change default options:

const streamStorage = new StreamStorage({
  maxMemorySize:      (32 * 1024),  // max memory size, bytes
  tmpDir:             '.',          // temp dir for a file
  pushMsec:           1,            // pushed data interval, msec
  chunkSize:          (8 * 1024),   // pushed data chunk size, bytes
});

For rereading data you can move current stream to new by StreamStorage.move().

More using cases and examples you can see in test.

Contributors

Thanks to the node-stream-buffer for inspiration!

dev

test

For run test:

npm run test

versions

  • 0.0.1 - init
  • 0.0.2
  • 0.0.3
  • 0.0.4
  • 0.0.5 - fix pause
  • 1.0.0 - .mjs, impl StreamStorage.move()

Keywords

FAQs

Package last updated on 26 Aug 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc