database
raw JSON → 0.0.2 verified Sat Apr 25 auth: no javascript abandoned
The `database` package (v0.0.2) is an experimental, minimalistic npm module designed to provide a unified configuration and require pattern around existing database drivers, rather than imposing a generic ORM/ODM model. It acts as a curated wrapper for database packages like CouchDB and MongoDB, allowing each adapter to define its own API. Currently no adapters are included; the package is in early prototype stage and not production-ready. It offers no API of its own, only a pattern for adapter development.
Common errors
error TypeError: database.couchdb is not a function ↓
cause Package has no adapters; attempting to use a non-existent method.
fix
Install and require a real database driver like 'couchdb' or 'mongodb'.
error Cannot find module 'database/couchdb' ↓
cause Package does not ship any adapters.
fix
Use a specific driver module (e.g., 'nano' for CouchDB).
Warnings
breaking The package exports an empty object; no adapters are included. ↓
fix Use specific database drivers directly (e.g., 'mongodb', 'couchdb') instead of this package.
Install
npm install database yarn add database pnpm add database Imports
- default
import database from 'database' - require wrong
const { database } = require('database')correctconst database = require('database') - adapter
const couchdb = require('database/couchdb')
Quickstart
// This package currently has no usable API.
// To use a database, install a specific driver directly.
const { MongoClient } = require('mongodb');
const client = new MongoClient(process.env.MONGO_URI ?? '');
client.connect().then(() => console.log('connected'));