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

zenith-db

v1.0.3

Published

A lightweight, easy-to-use database implementation for Node.js

Readme

ZenithDB

ZenithDB is a simple lightweight, easy-to-use database implementation for Node.js. It provides a simple API for storing and querying data, with support for aggregation, replication, concurrency, and more. With ZenithDB, you can quickly and easily add database functionality to your Node.js projects, without the need for a full-fledged database management system.

Installation

You can install ZenithDB using npm:

npm install zenith-db

Usage

Here's an example of how to use ZenithDB:

const ZenithDB = require('zenith-db');

// Create a new instance of ZenithDB
const db = new ZenithDB('my-data.json');

// Set some data
db.set('key1', { name: 'Alice', age: 25 });
db.set('key2', { name: 'Bob', age: 30 });
db.set('key3', { name: 'Charlie', age: 35 });

// Query the data
const result1 = db.query({ field: 'name', operation: 'equal', value: 'Alice' });
console.log(result1); // [{ name: 'Alice', age: 25 }]

const result2 = db.query({ field: 'age', operation: 'greaterThan', value: 30 });
console.log(result2); // [{ name: 'Charlie', age: 35 }]

const result3 = db.query({ field: 'name', operation: 'equal', value: 'Alice', count: true });
console.log(result3); // 1

const result4 = db.query({ field: 'age', aggregate: 'average' });
console.log(result4); // 30

const result5 = db.query({ map: (item) => item.age, reduce: (acc, value) => acc + value });
console.log(result5); // 90

// Delete a record
db.delete('key2');

// Replicate data to another instance of ZenithDB
db.replicate('replicationFilePath');

ZenithDB API

new ZenithDB(filePath: string): ZenithDB - creates a new instance of ZenithDB with the given file path for data storage.

set(key: string, value: any): void - sets the value for the given key.

get(key: string): any - retrieves the value for the given key.

delete(key: string): void - deletes the value for the given key.

query(query: Query): any[] | number - queries the data using the given query object and returns an array of results or a count.

replicate(filePath: string): void - replicates the data to the given file path.

The filePath parameter in the constructor and the replicate function should be the path to the file where the data will be stored and replicated. The query parameter in the query function should be an object with the following properties:

  • field (string) - the field to search for.
  • operation (string) - the operation to perform on the field, such as 'equal', 'greaterThan', etc.
  • value (any) - the value to compare the field to.
  • count (boolean) - whether to return the count of the results instead of the results themselves.
  • aggregate (string) - the type of aggregation to perform, such as 'average', 'sum', etc.
  • map (function) - a mapping function to apply to each item before reducing.
  • reduce (function) - a reducing function to aggregate the mapped values.

Note that ZenithDB creates a replication file with the same name as the data file but with the extension .replication.json. This file is used to store the replicated data.