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

midb

v2.0.0

Published

A cool JSON-based database using tables! :)

Readme

midb

Perfect tables-based database made for you! <3

Install:

npm i midb

Setup:

import { Database } from "midb";

const db = new Database({
    path: './database',
    tables: ['main']
})

db.on('ready', () => {
    console.log('Database is connected.')
})

db.start() // let's start the class

Methods

Set

Add or re-set something to the database.

  • Usage: <Database>.set(key: string, value: any, table?: string): Promise<void>

  • Example:

// ...
(async() => {
    await db.set('foo', 'bar')
    await db.set('collection.admin', 'Mid', 'Users') // add 'Users' table to the constructor
})()
// ...

Get

Get something from the database.

  • Usage: <Database>.get(key: string, table?: string): Promise<any>

  • Example:

// ...
(async() => {
    db.get('foo').then(console.log) // 'bar'
    db.get('collection', 'Users').then(console.log()) // { "admin": "Mid" }
})()
// ...

Push

Add a new element to an array in the database.

  • Usage: <Database>.push(key: string, value: any, table?: string): Promise<void>

  • Example:

// ...
(async() => {
    await db.push('foods', 'apple')
    await db.push('foods', 'banana')
    // lets get all:
    db.get('foods').then(console.log) // ['apple', 'banana']
})()
// ...

Remove

Remove an element from an array in the database.

  • Usage: <Database>.remove(key: string, value: any, table?: string): Promise<void>

  • Example:

// ...
(async() => {
    // before:
    db.get('foods').then(console.log) // ['apple', 'banana']
    // lets remove apple:
    await db.remove('foods', 'apple')
    // after:
    db.get('foods').then(console.log) // ['banana']
})()
// ...

Add

Add some amount to a number in the database.

  • Usage: <Database>.add(key: string, value: number, table?: string): Promise<void>

  • Example:

(async() => {
    await db.add('participants', 5, 'Polls') // add 'Polls' table to the constructor
    db.get('participants', 'Polls').then(console.log) // 5
    await db.add('participants', 10, 'Polls')
    db.get('participants', 'Polls').then(console.log) // 15
})()

Sub

Sub some amount from a number in the database.

  • Usage: <Database>.sub(key: string, value: number, table?: string): Promise<void>

  • Example:

(async() => {
    db.get('participants', 'Polls').then(console.log) // 15
    await db.sub('participants', 5, 'Polls')
    db.get('participants', 'Polls').then(console.log) // 10
})()

Has

Check if the database has a key value.

  • Usage: <Database>.has(key: string, table?: string): Promise<boolean>

  • Example:

(async() => {
    await db.set('myobject', { "a": 1, "b": 2 })
    db.has('myobject.b').then(console.log) // true
    db.has('myobject.c').then(console.log) // false
})()

Delete

Delete something from the database.

  • Usage: <Database>.delete(key: string, table?: string): Promise<void>

  • Example:

(async() => {
    await db.set('test', { "foo" true, "bar": "sup" })
    db.get('test').then(console.log) // { "foo": true, "bar": "sup" }
    await db.delete('test.bar')
    db.get('test').then(console.log) // { "foo": true }
})()

Ping

Check the database latency (miliseconds).

  • Usage: <Database>.ping(): Promise<number>

  • Example:

(async() => {
    let ping = await db.ping()
    console.log(ping) // 5, so 5 miliseconds
})()

Get table

Get a table object (like all).

  • Usage: <Database>.getTable(name: string): Record<string, any> | null

  • Example:

(async() => {
    let all = db.getTable('main')
    console.log(all) // { full Object }
})()

Start

Starts the database (very important).

  • Usage: <Database>.start()

  • Exmaple:

import { Database } from "midb";

const db = new Database()

db.start() // now we can use our midb database :)