New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

Node stream storage

Version npm

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

npm install stream-storage --save

Usage

const { StreamStorage } = require('stream-storage');
const streamStorage = new StreamStorage();
// using ...
streamStorage.destroy();

stream-storage

StreamStorage extends the standard stream.Duplex interface. All writes data to this stream will accumulate in internal Buffer. If the internal buffer overflows it will be resized automatically. The initial size of the Buffer and the amount in which it grows can be configured in the constructor. Data exceeding the maxSize of the size will be saved to a file.

You can change default options:

const streamStorage = new StreamStorage({
  initialSize:      (8 * 1024),  // initial memory buffer size
  incrementAmount:  (16 * 1024), // grow size after buffer overflows
  maxSize:          (32 * 1024), // max size buffer: will be saved to a file
  tmpDir:           '.',         // temp dir for a file
  chunkSize:        (8 * 1024)   // max reading chunk
});

Contributors

Thanks to the node-stream-buffer for inspiration!

dev

test

For run test:

npm run test

Keywords

FAQs

Package last updated on 13 Aug 2019

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