Registry / storage / abstract-blob-store

abstract-blob-store

JSON →
library3.3.5jsnpmunverified

abstract-blob-store defines a de-facto standard streaming file storage/retrieval interface for Node.js, inspired by abstract-leveldown. At version 3.3.5, it provides a reusable test suite and API contract that multiple storage backends (local, S3, Google Cloud, IPFS, Azure, etc.) implement consistently. Key differentiators: enforces a uniform streaming API for createWriteStream/createReadStream/exists/remove operations; ships TypeScript types; decouples implementation from testing via a shared test module. Currently unmaintained since 2019, but widely depended upon across the blob store ecosystem.

npm install abstract-blob-store
INSTALL
IMPORT
SIG · ABSTRACT-BLOB-STOR
A
abstract-blob-store
storagejavascriptv3.3.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tests
import tests from 'abstract-blob-store/tests'
const tests = require('abstract-blob-store')
The main export is the API interface, but the test suite is under '/tests' subpath. Both ESM and CJS are supported.
API interface
import blobStore from 'abstract-blob-store'; const store = blobStore()
import { blobStore } from 'abstract-blob-store'
Default export is the function to create a store instance; named exports are not available.
BlobStore type
import type { BlobStore } from 'abstract-blob-store'
import { BlobStore } from 'abstract-blob-store'
Type-only import for TypeScript users; the interface is not a runtime value.

Shows how to implement a custom blob store and run it against the abstract test suite using tape.

import test from 'tape'; import tests from 'abstract-blob-store/tests'; export default function createMyBlobStore() { return { createWriteStream: (opts, cb) => { // ... }, createReadStream: (opts) => { // ... }, exists: (opts, cb) => { // ... }, remove: (opts, cb) => { // ... } }; } const common = { setup: (t, cb) => { const store = createMyBlobStore(); cb(null, store); }, teardown: (t, store, blob, cb) => { if (blob) store.remove(blob, cb); else cb(); } }; tests(test, common);
Debug
Known issues
gotchaThe test suite expects tape or tap-compatible test framework; using jest or mocha may cause failures.
fix
Use tape (npm install tape) and run with node test.js instead of jest.
affects: >=1.0
deprecatedPackage is effectively unmaintained since 2019; no new releases or bugfixes expected.
fix
Consider alternatives like abstract-leveldown for new projects, or fork if needed.
affects: 3.x
gotchacreateWriteStream does not return a writable stream in all implementations; API is callback-based for metadata.
fix
Always check the callback for blob metadata rather than relying on stream events.
affects: >=1.0
breakingVersion 3.0 dropped support for Node.js < 10; older versions use callbacks differently.
fix
Upgrade to 3.x or pin to 2.x for Node 8/9 compatibility.
affects: <3.0
Errors
Common errors & fixes
TypeError: createWriteStream is not a function
Importing the main module instead of implementing the API in your store object.
fix
Ensure your store object has createWriteStream method; if using the abstract module, it exports a factory, not a ready-to-use store.
Error: Cannot find module 'abstract-blob-store/tests'
Using an old version (pre-3.0) where the test path was different.
fix
Upgrade to >=3.0.0 and use require('abstract-blob-store/tests') instead of require('abstract-blob-store/test')
TypeError: common.setup is not a function
Passing an object with missing or incorrectly named common methods.
fix
Define common.setup and common.teardown as functions that take (t, cb) and (t, store, blob, cb) respectively.
AssertionError: Expected true, got false
exists callback returns a boolean but implementation returns undefined.
fix
Ensure exists passes 'true' or 'false' (as boolean) in the callback: cb(null, true) if blob exists.
Upgrade
Version history
3.3.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
59 hits · last 30 days
node
50
OpenAI (training)
1
Resources
abstract-blob-store — npm install abstract-blob-store · libregistry