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

ledb

v0.4.0

Published

LEDB interface for NodeJS

Downloads

6

Readme

LEDB interface for NodeJS

License: MIT npm version npm downloads Travis-CI Build Status Appveyor Build status

The LEDB is an attempt to implement simple but efficient, lightweight but powerful document storage.

The abbreviation LEDB may be treated as an Lightweight Embedded DB, also Low End DB, also Literium Engine DB, also LitE DB, and so on.

Links

Features

  • Processing JSON documents
  • Identifying documents using auto-incrementing integer primary keys.
  • Indexing fields of documents using unique or duplicated indexes.
  • Searching and ordering documents using indexed fields or primary key.
  • Selecting documents using complex filters with fields comparing and logical operations.
  • Updating documents using rich set of modifiers.
  • Storing documents into independent storages so called collections.
  • Flexible JSON query filters similar to a MongoDB.
  • The LMDB as backend for document storage and indexing engine.

Installation

Until pre-compiled binaries is missing you need Rust build environment for building native module.

Use latest stable Rust compiler. You can install it using rustup or packages in your system.

Usage example

import { Storage } from 'ledb';

// Open storage
const storage = new Storage("test_db/storage");
// It allows open storage with same path multiple times

// Get storage info
console.log("Storage info:", storage.get_info());
console.log("Storage stats:", storage.get_stats());

// Get collection handle
const posts = storage.collection("post");

// Insert document
let doc_id = posts.insert({title: "Foo", tag: ["Bar", "Baz"], timestamp: 1234567890);

// Get document by id
let doc = posts.get(doc_id);
console.log("Inserted document: ", doc);

// Put new version of document
posts.put(doc);

// Delete document by id
posts.delete(doc_id);

// Ensure indexes
posts.ensure_index("title", "unique", "string")
posts.ensure_index("tag", "index", "string")

// Get indexes
console.log("Indexes of post:", posts.get_indexes())

// Find all documents
let docs = posts.find(null);

// Find all documents with descending ordering
let docs = posts.find(null, "$desc");

// Find all documents with ascending ordering using field
let docs = posts.find(null, { timestamp: "$asc" });

// Find documents using filter
let docs = posts.find({ title: { $eq:"Foo" } });
let docs = posts.find({ $not: { title: { $eq: "Foo" } } });
let docs = posts.find({ $and: [ { timestamp: { $gt: 123456789 } } ,
                                { tag: { $eq: "Bar" } } ] },
                      { timestamp: "$desc" });
let docs = posts.find({ $or: [ { title: { $eq: "Foo" } } ,
                               { title: { $eq: "Bar" } } ] });

// Number of found documents
console.log("Found docs:", docs.count())

// Get documents one by one
for (let doc; doc = docs.next(); ) {
    console.log("Found doc:", doc);
}

// Skip N documents
docs.skip(3);

// Take N documents only
docs.take(5);

// Get all documents as an array
console.log("Found documents:", docs.collect());

// Update all documents
posts.update(null, { timestamp: { $set: 0 } });

// Update documents using filter
posts.update({ timestamp: { $le: 123456789 } }, { timestamp: { $set: 0 } });

// Remove all documents
posts.remove(null);

// Remove documents using filter
posts.remove({ timestamp: { $le: 123456789 } });

See also ledb.d.ts.