browser-cache-blob-store

1.1.1 • Public • Published

browser-cache-blob-store

build status

npm

blob-store-compatible

blob store that stores blobs using the browser Cache interface. This interface is part of the Service Worker spec but is available to windowed scopes as well as workers.

npm install browser-cache-blob-store

Usage

var cacheStore = require('browser-cache-blob-store')
var collect = require('collect-stream')
var blobs = cacheStore()
 
var ws = blobs.createWriteStream({
  key: 'some/path/file.txt'
}, function (err, opts) {
  collect(blobs.createReadStream(opts.key), function (err, readBuf) {
    console.log(readBuf.toString())
  })
})
 
ws.write('hello world\n')
ws.end()

Known Issues

The blob will not be immediately available after the writable stream emits the finish event. To be sure it is ready, use the callback.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i browser-cache-blob-store

Weekly Downloads

4

Version

1.1.1

License

MIT

Unpacked Size

11.8 kB

Total Files

9

Last publish

Collaborators

  • gmaclennan