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

dynabase

v1.0.2

Published

World's fastest TKV database with KV support.

Downloads

11

Readme

Dynabase

World's fastest TKV (Table-Key-Value) database with KV support for Node.js. Written in TypeScript with both CommonJS and ESM support.

Version License Node Version

Features

  • 🚀 Ultra-fast in-memory database with file persistence
  • 📦 Supports both KV (Key-Value) and TKV (Table-Key-Value) modes
  • 💾 Automatic data persistence
  • 🔄 Automatic file descriptor management
  • 🔒 Safe process termination handling
  • 📁 JSON storage with compression option
  • 📦 Both ESM and CommonJS support

Installation

npm install dynabase

Quick Start

Key-Value Mode (KV)

const db = require('dynabase');

async function main() {
    // Initialize in KV mode
    await db.init({
        path: "./data",    // Storage directory
        type: "kv",        // Database type
        compress: true     // Enable compression
    });

    // Set values
    db.set('user1', { name: 'John', age: 30 });

    // Get values
    const user = db.get('user1');

    // Delete values
    db.delete('user1');
}

Table-Key-Value Mode (TKV)

const db = require('dynabase');

async function main() {
    // Initialize in TKV mode
    await db.init({
        path: "./data",    // Storage directory
        type: "tkv",       // Database type
        compress: true     // Enable compression
    });

    // Set values
    db.set('users', 'user1', { name: 'John', age: 30 });

    // Get values
    const user = db.get('users', 'user1');

    // Delete values
    db.delete('users', 'user1');
}

API Reference

Initialization

interface DatabaseConfig {
    path: string;         // Storage directory path
    type: 'tkv' | 'kv';   // Database type
    compress?: boolean;    // Enable JSON compression
}

await db.init(config: DatabaseConfig): Promise<boolean>

Core Operations

KV Mode

  • set(key: string, value: any): boolean
  • get(key: string): any
  • delete(key: string): boolean

TKV Mode

  • set(table: string, key: string, value: any): boolean
  • get(table: string, key: string): any
  • delete(table: string, key: string): boolean

Additional Functions

Reset Table/Database

// In KV mode: resets entire database
await db.reset('default');

// In TKV mode: resets specific table
await db.reset('tableName');

Manual Flush

// Force write to disk
await db.flush();

Database Info

const info = db.info();
/*
{
    version: string;
    author: string;
    async: boolean;
    initStatus: boolean;
    type: 'tkv' | 'kv';
    compression: boolean;
    storagePath: string;
    functions: string[];
}
*/

Storage

  • Data is stored in JSON files in the specified directory
  • KV mode uses a single default.json file
  • TKV mode creates separate JSON files for each table
  • Automatic persistence every 5 seconds
  • Safe process termination handling

Best Practices

  1. Initialization

    • Always await db.init() before using other functions
    • Choose appropriate mode (KV/TKV) based on your data structure
  2. Data Types

    • Values can be any JSON-serializable data
    • Keys must be strings
    • Table names must be strings
  3. Performance

    • Use compression for large datasets
    • Group related data in tables (TKV mode)
    • Use KV mode for simple key-value storage
  4. Error Handling

    • All async operations return Promises
    • Check return values for operation success
    • Handle potential errors in async operations

License

GNU General Public License v3.0

Authors

CR072,
HolaClient