abstract-blob-store
abstract-blob-store copied to clipboard
Destroying blob stores
I really like abstract-blob-store and am using a few different blob stores currently (like fs- and idb-), but I'm a little stumped on the clean-up aspect. For example, fs-blob-store will happily mkdir when you init the module, but there's no general API for deleting the blob store -- just its keys. :disappointed:
This means clean-up must be implementation-specific (since your code will need to know whether to rimraf or to delete the index-db store, etc.) to prevent lingering side-effects of the blob store, such as extra directories hanging around your FS or keys in your IndexedDB store.
This may be best served as a new API method on abstract-blob-store (maybe destroy?). Eager to get your thoughts on this @maxogden and @mafintosh (and anyone else excited about side effect free modules!).
I think this would be better left implementation specific, not all stores need cleanup
@jnordberg not all stores accept a key either (think createWriteStream for a content-addressable store --- it'd ignore whatever key input is given). Similarly, stores that don't need it wouldn't need to offer an implementation beyond process.nextTick(cb).