JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10730
  • Score
    100M100P100Q148024F
  • License MIT

Immediate put/get for abstract-chunk-store compliant stores

Package Exports

  • immediate-chunk-store

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (immediate-chunk-store) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

immediate-chunk-store travis npm downloads

Immediate put/get for abstract-chunk-store compliant stores

Makes store.put() chunks immediately available for store.get(), even before the store.put() callback is called. Data is stored in memory until the store.put() is complete.

Install

npm install immediate-chunk-store

Usage

var ImmediateChunkStore = require('immediate-chunk-store')
var FSChunkStore = require('fs-chunk-store') // any chunk store will work

var store = new ImmediateChunkStore(new FSChunkStore(10))

store.put(0, new Buffer('abc'), function () { /* yolo */ })

// And now, get the same chunk out BEFORE the put is complete
store.get(0, function (err, data) {
  if (err) throw err
  console.log(data.toString()) // 'abc'
})

License

MIT. Copyright (c) Feross Aboukhadijeh.