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 🙏

© 2025 – Pkg Stats / Ryan Hefner

bolt-browser-db

v0.0.7

Published

A Fast NoSQL Database for Browser that stores data clientside , Supports Schema .

Readme

Bolt Library: 🌟 A Lightweight IndexedDB Library

Bolt is a JavaScript library for working with 🗂️ IndexedDB in a MongoDB-like manner. It simplifies 🛠️ IndexedDB operations by offering methods for creating 📁 databases, performing CRUD operations ✍️, aggregations 📊, and summations ➕.


Features 🚀

1. Initialization 🛠️

The library automatically initializes a 🗂️ database for a given store name. If the database or store does not exist, it creates one automatically.

Example:

const db = new Bolt('MyStore');

Output:

Database 'MyStore' and store 'MyStore' created. ✅

2. Insert One ➕

Inserts a single 📄 document into the store.

Example:

await db.insertOne({ name: 'Alice', age: 25 });

Output:

Document inserted with ID: 1 ✅

3. Insert Many 📋

Inserts multiple 📄📄 documents into the store.

Example:

await db.insertMany([
  { name: 'Bob', age: 30 },
  { name: 'Charlie', age: 35 }
]);

Output:

Documents inserted with IDs: [2, 3] ✅

4. Find One 🔍

Finds a single 📄 document matching a given query.

Example:

const user = await db.findOne({ name: 'Alice' });
console.log(user);

Output:

{ _id: 1, name: 'Alice', age: 25 } ✅

5. Find 🔎

Finds all 📄📄 documents matching a given query.

Example:

const users = await db.find({ age: 30 });
console.log(users);

Output:

[{ _id: 2, name: 'Bob', age: 30 }] ✅

6. Update ♻️

Updates 📄📄 documents matching a query with new values.

Example:

await db.update({ name: 'Alice' }, { age: 26 });

Output:

Updated documents: [{ _id: 1, name: 'Alice', age: 26 }] ✅

7. Delete ❌

Deletes 📄📄 documents matching a query.

Example:

await db.delete({ age: 35 });

Output:

Deleted 1 document(s). ✅

8. Sum ➕

Calculates the sum of a field for 📄📄 documents matching a condition.

Example:

const totalAge = await db.sum('age', { name: 'Alice' });
console.log(totalAge);

Output:

Total age: 26 ✅

9. Aggregate 📊

Performs advanced data aggregation.

Example:

const result = await db.aggregate([
  { $match: { age: { $gte: 30 } } },
  { $group: { _id: 'age', totalAge: { initial: 0, totalAge: 'age' } } }
]);
console.log(result);

Output:

[{ _id: 'age', totalAge: 65 }] ✅

How to Use 🧑‍💻

  1. Include the Bolt library in your project.
  2. Initialize it with a store name 📁.
  3. Use its methods for CRUD operations ✍️ and advanced queries 🔍.

Limitations ⚠️

  • Each store is represented as a separate database.
  • No native support for joins or cross-store queries.

Full Example 🏗️

(async () => {
  const db = new Bolt('ExampleStore');

  // Insert data ➕
  await db.insertOne({ name: 'Alice', age: 25 });
  await db.insertMany([
    { name: 'Bob', age: 30 },
    { name: 'Charlie', age: 35 }
  ]);

  // Query data 🔍
  console.log(await db.findOne({ name: 'Alice' }));
  console.log(await db.find({ age: 30 }));

  // Update data ♻️
  await db.update({ name: 'Alice' }, { age: 26 });

  // Sum ages ➕
  const totalAge = await db.sum('age');
  console.log(`Total age: ${totalAge}`);

  // Aggregate data 📊
  const aggregated = await db.aggregate([
    { $match: { age: { $gte: 25 } } },
    { $group: { _id: 'total', sumAge: { $sum: 'age' } } }
  ]);
  console.log(aggregated);

  // Delete data ❌
  await db.delete({ name: 'Bob' });
})();