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

@basolt/db

v0.2.10

Published

A lightweight and modern TypeScript library for Basolt DB, a NoSQL document database.

Readme

@basolt/db

A lightweight and modern TypeScript library for interacting with Basolt DB, a NoSQL document database.

Installation

npm install @basolt/db

Usage

First, initialize the DB with your project's public key.

import { DB } from '@basolt/db';

const db = new DB({ publicKey: 'YOUR_PUBLIC_KEY' });

Then, select a collection to perform CRUD operations.

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

// Create a new record
const { data: newUser, error: createError } = await users.create({
  name: 'John Doe',
  email: '[email protected]',
});

if (createError) {
  console.error(createError.message);
} else {
  console.log('Created user:', newUser);
}

// Find records
const { data: foundUsers, error: findError } = await users.find({
  email: '[email protected]',
});

// Update a record
const { data: updatedUser, error: updateError } = await users
  .update({ name: 'Johnathan Doe' })
  .eq('id', newUser.id);

// Delete a record
const { data: deletedResult, error: deleteError } = await users
  .delete()
  .eq('id', newUser.id);

API

new DB({ publicKey })

Creates a new DB instance.

  • publicKey (string, required): Your Basolt project's public API key.

db.collection(name)

Selects a collection to perform operations on.

  • name (string, required): The name of the collection.

collection.create(data)

Creates a new record.

  • data (object, required): The data for the new record.

collection.find(columns)

Initiates a query to find records. This method returns a QueryBuilder instance, which allows you to chain filters, sorting, and pagination methods.

  • columns (string, optional): A comma-separated list of columns to retrieve. Defaults to * (all columns).

Once you have built your query, you can await the chain to execute it and get the results.

Example:

const { data, error } = await db
  .collection('users')
  .find('id, name, email')
  .eq('status', 'active')
  .order('createdAt', { ascending: false })
  .limit(10);

Update Records

Update records in a collection. The update method returns a MutationBuilder instance that allows you to chain filters to specify which records to update.

// Update records matching a filter
const { data, error } = await db
  .collection('users')
  .update({ status: 'active' })
  .eq('is_verified', false);

Delete Records

Delete records from a collection. The delete method returns a MutationBuilder instance that allows you to chain filters to specify which records to delete.

// Delete records matching a filter
const { data, error } = await db
  .collection('users')
  .delete()
  .eq('status', 'inactive');

QueryBuilder Methods

  • .eq(column, value): Finds all rows where column is equal to value.
  • .neq(column, value): Finds all rows where column is not equal to value.
  • .gt(column, value): Finds all rows where column is greater than value.
  • .lt(column, value): Finds all rows where column is less than value.
  • .gte(column, value): Finds all rows where column is greater than or equal to value.
  • .lte(column, value): Finds all rows where column is less than or equal to value.
  • .order(column, { ascending }): Orders the results by column. ascending defaults to true.
  • .limit(count): Limits the number of returned rows to count.
  • .offset(count): Skips count rows.
  • .single(): Fetches a single record instead of an array. If no record is found, it returns null. This is a convenience method that sets the limit to 1.