Socket
Socket
Sign inDemoInstall

chunk-store-stream

Package Overview
Dependencies
6
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    chunk-store-stream

Convert an abstract-chunk-store compliant store into a readable or writable stream


Version published
Weekly downloads
1.3K
decreased by-18.61%
Maintainers
4
Install size
194 kB
Created
Weekly downloads
 

Readme

Source

chunk-store-stream ci npm downloads javascript style guide

Convert an abstract-chunk-store store into a readable or writable stream

abstract chunk store

Read/write data from/to a chunk store, with streams.

Install

npm install chunk-store-stream

Usage

Create a read stream

const { ChunkStoreReadStream } = require('chunk-store-stream')
const FSChunkStore = require('fs-chunk-store') // any chunk store will work

const chunkLength = 3
const store = new FSChunkStore(chunkLength)

// ... put some data in the store

const stream = new ChunkStoreReadStream(store, chunkLength, { length: 6 })
stream.pipe(process.stdout)

Create a write stream

const { ChunkStoreWriteStream } = require('chunk-store-stream')
const FSChunkStore = require('fs-chunk-store') // any chunk store will work
const fs = require('fs')

const chunkLength = 3
const store = new FSChunkStore(chunkLength)

const stream = new ChunkStoreWriteStream(store, chunkLength)
fs.createReadStream('file.txt').pipe(stream)

License

MIT. Copyright (c) Feross Aboukhadijeh.

Keywords

FAQs

Last updated on 08 Mar 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc