Registry / database / bfast-database

bfast-database

JSON →
library4.0.0-beta.2jsnpmunverified

Node.js database runtime instance for Bfast::Cloud::Database, currently in beta v4.0.0-beta.2. It acts as a database-as-a-service engine that wraps MongoDB (or optionally S3 for storage) and provides a REST API for client-side operations. Key differentiators: integrates with bfast-tools CLI, supports multiple databases (MongoDB, GridFS, S3), provides JWT authentication, and offers both restart and non-restart modes. The package is part of the Bfast ecosystem and is intended for use with bfast-tools. Development appears active with recent beta releases.

npm install bfast-database
INSTALL
IMPORT
SIG · BFAST-DATABASE
B
bfast-database
databasejavascriptv4.0.0-beta.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

BfastDatabase
import BfastDatabase from 'bfast-database';
const BfastDatabase = require('bfast-database');
ESM-only package; CommonJS require is not supported.
initialize
import { initialize } from 'bfast-database';
import initialize from 'bfast-database';
Named export, not a default export.
BfastDatabase (type)
import type { BfastDatabase } from 'bfast-database';
TypeScript usage for type imports.

Initialize and start bfast-database with required environment variables.

import BfastDatabase from 'bfast-database'; const db = new BfastDatabase({ applicationId: process.env.APPLICATION_ID || 'bfast', masterKey: process.env.MASTER_KEY || 'bfast', projectId: process.env.PROJECT_ID || 'bfast', databaseURI: process.env.DATABASE_URI || 'mongodb://localhost/bfast', port: parseInt(process.env.PORT || '3000'), production: process.env.PRODUCTION === '1', rsaKey: process.env.RSA_KEY ? JSON.parse(process.env.RSA_KEY) : undefined, rsaPublicKey: process.env.RSA_PUBLIC_KEY ? JSON.parse(process.env.RSA_PUBLIC_KEY) : undefined }); await db.start(); console.log('bfast-database running on port', db.port);
Debug
Known issues
breakingbfast-database v4 is a complete rewrite; APIs from v3 are not compatible.
fix
Refer to v4 documentation or migrate from v3.
affects: >=4.0.0-beta.0
deprecatedbfast-tools CLI is required for server mode; standalone usage may not be fully supported.
fix
Install bfast-tools globally: npm install -g bfast-tools
affects: >=4.0.0-beta.0
gotchaEnvironment variables must be set before starting; defaults only apply in development mode (PRODUCTION='0').
fix
Set APPLICATION_ID, MASTER_KEY, PROJECT_ID, DATABASE_URI in production.
affects: >=4.0.0-beta.0
Errors
Common errors & fixes
Error: Cannot find module 'bfast-tools'
bfast-tools is not installed globally.
fix
Run: npm install -g bfast-tools
MongoError: Authentication failed
Invalid MongoDB credentials or database URI.
fix
Check DATABASE_URI env variable; ensure user/password are correct.
TypeError: BfastDatabase is not a constructor
Using CommonJS require instead of ESM import.
fix
Use import BfastDatabase from 'bfast-database';
Upgrade
Version history
4.0.0-beta.2latest on npm
Audit
Dependencies
bfast-toolsrequiredRequired to run the database instance in server mode
mongodboptionalPrimary database driver, though can be used with S3 for storage
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
bfast-database — npm install bfast-database · libregistry