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

dotdatabase

v1.1.3

Published

A leightweight easy to use local json database

Downloads

49

Readme

DotDB - Leightweight Local JSON Database

DotDB is a easy to use and leightweight local database that uses JSON to store data. It also supports different "directories" by usings dots. See this.
You can install it by running:

npm install dotdatabase

The NPM package can be found here.

Current Version: 1.1.2 (Stable Version)

Getting started

To create a database, you need to import dotdb and create a new instance of the class.

import DotDB from "dotdatabase";

const database = new DotDB("path/to/your/db.json"); // Directories
// OR
const database = new DotDB("db.json"); // In the root directory

Methods

There are ten different methods to use.
set, multiset, delete, multidelete, get, has, keys, values, all, clear

All the tutorials below will assume that the db is:

{
    "1": "2",
    "key": "value",
    "user_723": {
        "name": "John Doe",
        "age": 30,
        "email": "[email protected]",
        "address": {
            "street": "123 Main St",
            "city": "Anytown",
            "state": "CA",
            "zip": "12345"
        }
    }
}

Set and Multiset

set allows you to set a key to a value in the database

database.set("k", "v")

multiset allows you to set multiple keys and values at once

database.multiset({ "k": "v", "k2": "v2" })

Delete and Multidelete

delete allows you to remove a key from the database

database.delete("key")

multidelete allows you to delete multiple keys at once

database.multidelete(["1", "key", "user_723"])

Get and Has

get allows you to get a value from a key from the database.
Make sure to use await before.

const value = await database.get("key")
console.log(value) // -> "value"

has allows you to check if a key-value pair exists in the database and returns true if it exists and false if not. Make sure to use await before.

console.log( await database.has("key") ); // -> true
console.log( await database.has("abc") ); // -> false

Keys and Values

keys allows you to get all keys from the database.
Make sure to use await before.

console.log( await database.keys() ); // ->
// [
//   '1',
//   'key',
//   'user_723.name',
//   'user_723.age',
//   'user_723.email',
//   'user_723.address.street',
//   'user_723.address.city',
//   'user_723.address.state',
//   'user_723.address.zip'
// ]

values allows you to get all values from the database.
Make sure to use await before

console.log( await database.values() ); // ->
// [
//   '2',
//   'value',
//   'John Doe',
//   30,
//   '[email protected]',
//   '123 Main St',
//   'Anytown',
//   'CA',
//   '12345'
// ]

All and Clear

all returns the entire database as a Record.
Make sure to use await before

console.log( await database.all() ); // ->
// {
//   '1': '2',
//   key: 'value',
//   user_723: {
//     name: 'John Doe',
//     age: 30,
//     email: '[email protected]',
//     address: {
//       street: '123 Main St',
//       city: 'Anytown',
//       state: 'CA',
//       zip: '12345'
//     }
//   }
// }

clear clears the entire database and replaces it with {}.
You need to confirm it when writing the function.

await db.clear(true) // -> `true` is to confirm

What are "dot directories"?

Dot directories are kind of like paths. For example insead of doing this:

database.set("player", { health: 100 })

You can just simply do this:

database.set("player.health", 100)

Those two will have the same result.
You can use those "dot direcotries" on all functions.