/cache-storage-chunk-store

Browser CacheStorage chunk store that is abstract-chunk-store compliant

Primary LanguageJavaScriptMIT LicenseMIT

cache-storage-chunk-store

npm downloads dependencies license

Browser CacheStorage chunk store that is abstract-chunk-store compliant

abstract chunk store

Install

npm install cache-storage-chunk-store

or include it directly:

<script src="https://cdn.jsdelivr.net/npm/cache-storage-chunk-store@1.x/dist/cache-storage-chunk-store.min.js"></script>

Usage

const CacheStorageChunkStore = require('cache-storage-chunk-store')

const chunks = new CacheStorageChunkStore(10)

chunks.put(0, buffer, (err) => console.error(err))

chunks.get(0, (err, buf) => console.log(err, buf))

Known issues

Chrome can stall and never finish if running many get calls concurrently.

Specifically this problem occurs when calling the ReadableStream.getReader.read() function more than once.

License

MIT