1. idbkv-chunk-store
Abstract chunk store built on idb-kv: the lightweight and simple API for indexeddb with automatic batching
idbkv-chunk-store
Package: idbkv-chunk-store
Created by: KayleePop
Last modified: Thu, 05 May 2022 15:27:51 GMT
Version: 1.1.2
License: MIT
Downloads: 17
Repository: https://github.com/KayleePop/idbkv-chunk-store

Install

npm install idbkv-chunk-store
yarn add idbkv-chunk-store

idbkv-chunk-store

Greenkeeper badge
Travis badge
standard badge
npm

Abstract chunk store implementation built on idb-kv: a small IndexedDB wrapper that automatically batches for performance.

abstract chunk store

Install

npm install idbkv-chunk-store

Usage

See abstract-chunk-store

 var IdbkvChunkStore = require('idbkv-chunk-store')
var store = new IdbkvChunkStore(10,
  {
    name: 'example', // data will persist to future instances with this same name Default='idbkv-chunk-store'
    length: 37, // allows partial final chunks Default=Infinity
    batchInterval: 10 // sets batch interval for idb-kv Default=10ms
  }
)

store.put(0, Buffer.from('0123456789'), (err) => {
  if (err) throw err
  store.get(0, (err, chunk) => {
    if (err) throw err
    console.log(chunk) // outputs '0123456789' as a buffer
  })
})

Compatibility

idb-kv uses async functions, so those need to be supported to use this library.

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code