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

leo-db

v1.0.11

Published

A lightweight miniature json db with basic functionalities.

Readme

LeoDB

Lightweight Miniature JSON DB

Hello World, The use of JSON is at its peak and th future of the data being passed and store has a higher potential of also being in JSON format. Thus im presenting you with this module of which makes it extremely easy to perform DB like queries on the JSON data.

// Import the module
const leoDB = require("leo-db");

This module provides following functionality,

  1. Loading data from file.
  2. Saving the data to a file.
  3. Performing a search query.
  4. Performing an insert query.
  5. Performing a update query.
  6. Performing a delete query.

I have tried implementing the module to save save using key replacement method to a general structure. Thus reducing the data size without affecting the runtime efficiency.

// Loading an existing DB from the Local disk.
leodb.LoadDB();

// Save the DB to the loacl disk.
leodb.SaveDB();

Now to make a new DB or remove an existing DB we have the following functions, (DB here means the collection/table)

// Create a new DB.
leoDB.NewDB("Enter_DB_Name", ["field_1", "field_2", "field_3"]);

// Delete a particular DB and remove all data.
leoDB.DeleteDB("Enter_DB_Name");

Select the database you want to perform the query on.

// Select the DB. (Only once for multiple query on same DB)
leoDB.SelectDB("Enter_DB_Name");

Performing Insert Query


// Single Data Insert
leoDB.Insert({
    field_1: "value_1",
    field_2: "value_2",
    field_3: "value_3",
});

// Multiple Data Insert
leoDB.Insert([
    {
        field_1: "value_1",
        field_2: "value_2",
        field_3: "value_3",
    },
    {...},
    {...}
]);

Performing Update Query

// Data Update
leoDB.Update(
    {
        search_for_key: "search_for_value",
    },
    {
        update_field: "update_value",
    }
);

Performing Find Query

// Data Find (Returns all data)
leoDB.Find();

// Data Find (Returns all data thats matching)
leoDB.Find({
    search_field_1: "search_value_1",
    OR: {
        // Search for optional values matching.
        search_field_2: [
            "possible_value_1",
            "possible_value_2",
            "possible_value_3",
        ],
        search_field_3: [
            "possible_value_1",
            "possible_value_2",
            "possible_value_3",
        ],
    },
});

Performing Delete Query

// Data Delete
leoDB.Delete({
    search_for_key: "search_for_value",
});

// Delete all data. (Removes all the data);
leoDB.Delete();

Warning: Use with utmost care...its still under development.