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

kive.db

v1.0.0

Published

Modern key-value database for Node.js with MongoDB-like interface

Readme

kive.db ✨

A modern, fast, and efficient key-value database for Node.js

Apache License

Features

  • 🚀 Blazing fast performance with memory caching
  • 📝 Schema validation with custom rules
  • 🔍 Powerful query builder
  • 💾 Persistent storage with atomic writes
  • 🧵 Concurrent access support
  • 📦 Zero-dependency (optional dependencies for advanced features)

Installation

npm install kive.db@latest

Quick Start (ES Modules)

import { KiveDB, Schema } from 'kive.db';

// Initialize with custom options
const db = new KiveDB({
  storagePath: './mydata', // Custom storage location
  cacheSize: 2000,        // Increase cache size
});

// Define a schema
const blogSchema = new Schema({
  title: { type: String, required: true },
  content: String,
  tags: [String],
  views: { type: Number, default: 0 },
  publishedAt: { type: Date, default: Date.now }
});

// Create a model
const Blog = db.model('Blog', blogSchema);

// Add middleware
blogSchema.pre('save', async (data) => {
  console.log(`Saving blog: ${data.title}`);
});

// Usage example
async function main() {
  const article = await Blog.create({
    title: 'Getting Started with kive.db',
    content: '...',
    tags: ['database', 'nodejs']
  });

  console.log('Created article:', article);

  // Find articles with more than 100 views
  const popular = await Blog.find()
    .where('views').gt(100)
    .limit(5)
    .exec();

  console.log('Popular articles:', popular);
}

main().catch(console.error);

CommonJS Usage

const { KiveDB, Schema } = require('kive.db');
// ... same API as ESM version

API Reference

new KiveDB(options)

Create a new database instance.

Options:

  • storagePath: Path to store data files (default: './data')
  • cacheSize: Maximum items in cache (default: 1000)
  • writeBufferSize: Bytes to buffer before writing (default: 16384)

Schema(definition)

Define a schema for your data.

Definition properties:

  • type: Data type (String, Number, Date, etc.)
  • required: Mark field as required
  • default: Default value
  • validate: Custom validation function/regex

Model API

  • create(data): Create new document
  • findById(id): Find by primary key
  • find([query]): Create query builder
  • updateOne(query, update): Update first matching document
  • deleteOne(query): Delete first matching document
  • compact(): Optimize storage

Query Builder

Chainable methods:

  • where(field): Field to query
  • equals(value): Exact match
  • gt(value): Greater than
  • lt(value): Less than
  • in(array): Match any value in array
  • limit(n): Maximum results
  • skip(n): Skip first n results
  • exec(): Execute query
  • findOne(): Get first result

Performance Tips

  1. Increase cache size for read-heavy applications:

    const db = new KiveDB({ cacheSize: 5000 });
  2. Batch writes by default - no need to manually batch operations.

  3. Run compaction periodically for large datasets:

    await Blog.compact();
  4. Use indexes for frequently queried fields (automatic for _id).

License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.

Contact

If you have any questions, feel free to reach out to the author:

  • Name: Iscordian
  • Email: [email protected]
  • Discord: iscordian.dev
  • Discord Server: https://discord.gg/GQBWcyR9Cp