npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vikukumar/bulldb

v1.0.29

Published

One Model. Every Database. Advanced cross-language ORM/ODM supporting SQL, NoSQL, Vector, and Graph engines.

Readme

BullDB for TypeScript & Node.js

One Model. Every Database. Unified Security, AI, and High-Performance for TypeScript/Node.js.

BullDB is the world's most advanced cross-language ORM/ODM/Data Access Framework. This is the official npm package @vikukumar/bulldb.

With BullDB, you define a single Active Record model class and query it seamlessly across relational SQL engines (PostgreSQL, SQLite), document stores (MongoDB), key-value stores (Redis), and vector/graph databases under a unified schema-driven interface.


Installation

Install the package and dependencies via npm or yarn:

npm install @vikukumar/bulldb reflect-metadata

Make sure to enable decorators in your tsconfig.json:

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  }
}

Key Features

  1. Decorator-Driven Models: Native TS classes with @Field, @PrimaryKey, @Unique, and @Index decorators.
  2. Auto-Migrations: Transparent schema diffing and table modification/reconstruction.
  3. Zero-Dependency Field Encryption: Advanced AES-256-GCM secure field encryption with runtime key override (SecurityEngine.setEncryptionKey) and secure random fallbacks.
  4. Cross-Language Compatibility: Standardized binary payload layout (nonce (12b) + tag (16b) + ciphertext) allowing decryption across Python, TypeScript, Go, Rust, and C#.
  5. NextAuth.js Compatibility: Built-in NextAuth database adapters out of the box.
  6. Native AI Embeddings & RAG: Seamless RAG ingestion pipelines.

Quick Start Example

Here is a complete, ready-to-run TypeScript example:

import "reflect-metadata";
import { BaseModel, PrimaryKey, Unique, Field, UUID, Email, EncryptedString, HashedPassword, db } from "@vikukumar/bulldb";
import { MigrationEngine } from "@vikukumar/bulldb";
import { SecurityEngine } from "@vikukumar/bulldb";

// 1. Define your Active Record model class
class User extends BaseModel {
  @PrimaryKey()
  @Field(UUID())
  id!: string;

  @Unique()
  @Field(Email())
  email!: string;

  @Field(EncryptedString())
  secretNote!: string;

  @Field(HashedPassword())
  password!: string;
}

async function main() {
  // 2. Setup Multi-Engine Database Connection
  BaseModel.setDb(db);
  await db.connectAll();
  
  // 3. Initialize and run schema migrations
  const migrator = new MigrationEngine(db);
  migrator.registerModel(User);
  await migrator.generateAndApplySchema();

  // 4. Optional: Override default encryption key at runtime
  // (Default: uses BULLDB_ENCRYPTION_KEY env, or generates a secure random session key)
  SecurityEngine.setEncryptionKey(Buffer.from("my-custom-super-secret-key-32b-length"));

  // 5. Create and save a user
  const user = await User.create({
    email: "[email protected]",
    secretNote: "This is highly confidential TypeScript data.",
    password: "mySecurePassword123"
  });
  console.log(`Created User ID: ${user.id}`);
  
  // Note: Secret note is encrypted, and password is salted and hashed in the database!
  console.log(`Hashed Password in DB: ${user.password}`);

  // 6. Retrieve the user
  // Fetch by ID (automatic decryption of encrypted fields on load)
  const fetched = await User.getById(user.id);
  console.log(`Decrypted Secret Note: ${fetched.secretNote}`); // "This is highly confidential TypeScript data."

  // Find first record matching conditions
  const firstUser = await User.findFirst({ email: "[email protected]" });
  console.log(`Found User ID: ${firstUser?.id}`);

  // 7. Serialize to JSON (JSON output exposes decrypted fields cleanly)
  const jsonOutput = user.toJSON();
  console.log("JSON Output:", jsonOutput);

  // 8. Clean up / delete user
  await user.delete();
  console.log("User deleted successfully.");
  
  await db.disconnectAll();
}

main().catch(console.error);

NextAuth.js Integration

BullDB includes a built-in adapter for authentication flows with NextAuth.js:

import NextAuth from "next-auth";
import { db } from "@vikukumar/bulldb";
import { BullDBNextAuthAdapter } from "@vikukumar/bulldb";

export default NextAuth({
  adapter: BullDBNextAuthAdapter(db),
  providers: [
    // Configure authentication providers...
  ],
});

License

This package is licensed under the MIT License.