browser-cache-blob-store

abstract-blob-store compatible that stores blobs using the browser Cache interface

MIT License

Downloads
19
Stars
5

browser-cache-blob-store

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 blobs = cacheStore()

var ws = blobs.createWriteStream({
  key: 'some/path/file.txt'
})

ws.write('hello world\n')
ws.end(function() {
  var rs = blobs.createReadStream({
    key: 'some/path/file.txt'
  })

  rs.pipe(process.stdout)
})

License

MIT