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

@liorandb/core

v1.1.1

Published

LioranDB Core Module – Lightweight, local-first, peer-to-peer database management for Node.js.

Readme

@liorandb/core

LioranDB Core is a lightweight, encrypted, TypeScript-first embedded database engine for Node.js.

Think of it as:

  • LevelDB speed (powered by classic-level)
  • 🔐 Built-in encryption (transparent at rest)
  • 🧠 Mongo-like API (collections, queries, updates)
  • 📦 Zero external services (no server, no daemon)
  • 🧩 Type-safe by design (written 100% in TypeScript)

Perfect for:

  • Local-first apps
  • Desktop / CLI tools
  • Edge & serverless experiments
  • P2P & offline-sync systems

Features

  • 📂 Multiple databases under one manager
  • 📁 Multiple collections per database
  • 🔑 Optional encryption (AES-based, transparent)
  • 🧵 Write-queue for consistency (no race conditions)
  • 🧠 Simple query matching
  • 🧩 Strong TypeScript inference
  • 🚫 No native bindings
  • 🚀 Fast startup & low memory

Installation

npm install @liorandb/core

Quick Start (30 seconds)

import { LioranManager } from "@liorandb/core"

const manager = new LioranManager({
  encryptionKey: "my-secret-key"
})

const db = await manager.db("app")

const users = db.collection<{ name: string; age: number }>("users")

await users.insertOne({ name: "Swaraj", age: 17 })

const result = await users.find({ name: "Swaraj" })
console.log(result)

No config. No server. Just code.


Core Concepts

1️⃣ LioranManager

The root controller. Manages databases, encryption and lifecycle.

const manager = new LioranManager({
  rootPath: "./data",        // optional
  encryptionKey: "secret"   // optional
})

Responsibilities:

  • Creates databases
  • Opens databases
  • Tracks open instances
  • Applies encryption globally

2️⃣ Database

Each database is a folder on disk.

const db = await manager.db("mydb")
  • Databases are created automatically if missing
  • Re-opening returns the same instance

3️⃣ Collections

Collections are LevelDB instances stored inside the database.

const posts = db.collection<{ title: string; views: number }>("posts")
  • One folder per collection
  • Fully typed
  • JSON documents only

Collection API

insertOne

await users.insertOne({ name: "Alex", age: 22 })
  • Auto-generates _id
  • _id can be provided manually

find

const all = await users.find()
const adults = await users.find({ age: 18 })
  • Partial object matching
  • Returns an array

updateOne

await users.updateOne(
  { name: "Alex" },
  { $set: { age: 23 } }
)

Supported operators:

  • $set
  • $unset
  • $inc

Encryption

Encryption is transparent and automatic.

const manager = new LioranManager({
  encryptionKey: process.env.DB_KEY
})
  • Data is encrypted before writing to disk
  • Decrypted automatically on read
  • Wrong key = unreadable data

Encryption is global per manager instance.


File Structure on Disk

rootPath/
└─ app/
   ├─ users/
   ├─ posts/
   └─ comments/
  • Human-readable folders
  • Binary LevelDB data inside

Type Safety

LioranDB is TypeScript-native.

const users = db.collection<{ name: string; age: number }>("users")

users.insertOne({ name: "Sam" })      // ❌ age missing
users.insertOne({ name: "Sam", age: 20 }) // ✅

No any. No runtime guessing.


Closing Databases

await manager.closeDatabase("app")
  • Closes all collections
  • Flushes LevelDB handles

Design Philosophy

  • Simple > clever
  • Local-first
  • No magic network calls
  • Readable source > black box

LioranDB is intentionally small and hackable.


Roadmap

  • 🔁 P2P sync layer
  • 🧠 Indexing
  • 🧾 Schema validation
  • ⚡ WAL (write-ahead log)
  • 🌐 Browser storage adapter

License

LDEP


Author

Built by Swaraj Puppalwar 🚀

If you are building local-first or offline-first systems — this DB is for you.