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

tona-db-mini

v0.1.0

Published

Tona-DB mini is a JavaScript library for simulating small local databases in JSON.

Readme

A simple library to store and retrieve JSON data

License: MIT GitHub release

Summary

Explanation

Tona DB mini is a Node module written in TypeScript that provides the ability to store, update, and retrieve data persistently, much like a database would. It is designed to be simple to use and quick to set up, making it easy to integrate into a small project that requires data persistence without the need to implement a traditional and complex database. Data is stored in JSON format, which makes it easy to manipulate and migrate between projects. The module simulates a non-relational database with a system of collections.

Note: This project still under development. Many features are planned for future releases.

Installation

Simply run the following command to install the module from npm:

npm install tona-db-mini

Configuration

To configure the module, you can create a configuration file named tdb-mini.config.json in the root directory of your project. This file should contain the following properties:

{
  "dbPath": "./tdb-mini-data",
  "prettyJson": false
}
  • dbPath - The path to the database folder.
  • prettyJson - A boolean value that determines whether the JSON data should be formatted with indentation.

Usages

Basic Usage

import db from "tona-db-mini";

// Create your type for your collection
type User = {
  name: string;
  age: number;
};

const users = db.collection<User>("users");

// Add a new user
users.add({ name: "John Doe", age: 30 });

// Get user by name
const user = users.get({ name: "John Doe" });

Add data to collection

To add data to a collection, you can use the add method. The add method takes an object or an array of objects as an argument.

import db from "tona-db-mini";

// Create your type for your collection
type User = {
  name: string;
  age: number;
};

const users = db.collection<User>("users");

// Add a new user
users.add({ name: "John Doe", age: 30 });

// Add multiple users
users.add([{ name: "Jane Doe", age: 25 }, { name: "Bob Smith", age: 35 }]);

Get data from collection

To get data from a collection, you can use the get method. The get method takes an Filter as an argument. If no filter is provided, it will return all data from the collection.

import db from "tona-db-mini";

// Create your type for your collection
type User = {
  name: string;
  age: number;
};

const users = db.collection<User>("users");

// Get data from collection
const specificUser = users.get({ name: "John Doe" });

// Get all data from collection
const allUsers = users.get();

Update data in collection

To update data in a collection, you can use the update method. The update method takes a Filter and a partial data object as arguments.

import db from "tona-db-mini";

// Create your type for your collection
type User = {
  name: string;
  age: number;
};

const users = db.collection<User>("users");

// Update data in collection
users.update({ name: "John Doe" }, { age: 31 });

Delete data from collection

To delete data from a collection, you can use the del method. The del method takes an Filter as an argument. If no filter is provided, it will delete all data from the collection.

import db from "tona-db-mini";

// Create your type for your collection
type User = {
  name: string;
  age: number;
};

const users = db.collection<User>("users");

// Delete data from collection
users.del({ name: "John Doe" });

// Delete all data from collection
users.del();

Filters

You can use a filter to specify which data you want to get, update, or delete from a collection. The filter can be an object or a predicate function.

import db from "tona-db-mini";

// Create your type for your collection
type User = {
  name: string;
  age: number;
};

const users = db.collection<User>("users");

// Get user with name "John Doe"
const specificUser = users.get({ name: "John Doe" });

// Get users with age greater than 30
const olderUsers = users.get((user) => user.age > 30);

Compatibility

Tona DB mini is a very flexible JavaScript/TypeScript module: it works in Node.js (backend, scripts, serverless), in Deno, with the older CommonJS format (require), and even with a TypeScript runtime like tsx without a build step. In short, it fits smoothly into most modern or existing stacks.

| Environment / stack | Supported? | Usage notes | | ------------------------ | ---------- | --------------------------------------------- | | Node.js | ✅ | Backend apps, scripts, serverless | | Deno | ✅ | URL imports, secure runtime | | CommonJS (require) | ✅ | No need to migrate to ES Modules | | TS runtime (tsx) | ✅ | Run TypeScript directly, no build step needed |

Example in CommonJS

const db = require("tona-db-mini").default;

const users = db.collection("users");

// Add a new user
users.add({ name: "John Doe", age: 30 });

// Get user by name
const user = users.get({ name: "John Doe" });