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

scriba-sdk

v1.0.2

Published

Scriba is a minimalist, reactive, SQLite-powered ORM designed with one radical principle:

Readme

📝 Scriba — The Zero-Learning Curve Reactive ORM

Scriba is a minimalist, reactive, SQLite-powered ORM designed with one radical principle:

“If it feels like working with plain JavaScript objects, you're doing it right.”

Forget complex schemas, migrations, data mappers, or cryptic APIs. Scriba turns every database row into a live object: accessing a property loads it lazily, updating it writes to the database instantly, and relations behave like native properties.

Scriba is not just an ORM — it is the easiest and most intuitive persistence layer you can use in JavaScript.


🚀 Features

  • Zero Learning Curve You work with normal JS objects. No .save(), .update(), .populate(), .from(), or .select().

  • Auto-Persisting Objects Assigning a property automatically updates SQLite:

    user.name = "Alice"; // Writes instantly to DB
  • Lazy Loading Accessing a field loads it on demand:

    user = User[3]; // Auto SELECT * WHERE id = 3
  • Reactive Records Subscribe to live updates:

    user.subscribe(u => console.log("Updated:", u));
  • 1:N and N:N Relations Automatically Resolved If your schema defines relations, you get:

    user.posts;  // Auto SELECT posts
    user.roles;  // Auto SELECT through join table
  • Type-Aware Fields JSON → JS object datetime → Date instance boolean → native boolean

  • Hot Schema Reload (with auto-migrations) Update your .scriba schema file and watch your tables update automatically.

  • Multi-Tenant by Design Each tenant gets its own isolated SQLite database and schema.


📦 Installation

npm install scriba

(or whatever your real package name will be)


🧠 How It Works

Scriba uses four core abstractions:

Scriba

Multi-tenant manager, schema loader, table initializer.

TenantProxy

Gives easy access to entities inside a tenant.

TableProxy

Represents a database table. Responsible for:

  • lazy loading
  • record caching
  • inserts
  • queries
  • relation metadata

RecordProxy

Represents a single record. Through a JavaScript Proxy, it intercepts:

  • get → loads relations, parses types, returns cached values
  • set → normalizes, auto-updates SQLite, notifies subscribers, invalidates caches

🧩 Basic Usage

1. Initialize Scriba

import Scriba from "scriba";

const scriba = new Scriba([
  { id: "app", path: "./app.db", schema: "./schema.scriba" }
]);

2. Define a Schema (schema.scriba)

model User {
  id int
  name text
  age int
}

model Post {
  id int
  userId int
  title text
  content text
}

Scriba automatically:

  • creates tables if they don’t exist
  • adds missing columns
  • reloads when the file changes

3. Insert Data

const tenant = scriba.tenant("app");
const User = tenant.entity("User");

const alice = await User.push({
  name: "Alice",
  age: 25
});

4. Fetch Data (lazy)

const u = User[1]; // Auto SELECT

console.log(u.name);

5. Auto-Saving

u.age = 26; 
// Immediately: UPDATE User SET age = 26 WHERE id = 1

6. Relations (zero configuration)

If the schema contains something like userId, Scriba exposes:

u.posts;  
// SELECT * FROM Post WHERE userId = u.id

7. Reactive Subscriptions

u.subscribe(user => {
  console.log("User updated:", user);
});

Now any assignment triggers the subscriber.


🔥 Example: Many-to-Many

Assume the schema:

model User {
  id int
  name text
}

model Role {
  id int
  label text
}

model UserRole {
  userId int
  roleId int
}

Scriba detects User ↔ Role via UserRole.

Then you get:

user.roles; // Auto SELECT through join table

📊 Querying

Simple, expressive:

User.query(
  { age: { $gt: 18 } },
  { sort: "age DESC", limit: 10 }
);

Returns real RecordProxy instances.


❤️ Why Scriba?

While traditional ORMs (Prisma, Sequelize, Drizzle) require learning large APIs or DSLs, Scriba has one goal:

Make database persistence feel like normal JavaScript.

  • No .save()
  • No .update()
  • No .populate()
  • No decorators, models, or classes
  • No migrations to write manually

Just:

const tenant = scribe.tentant("database");
const user = tenant.entity("User");

user[1].name = "New Name";

console.log(user.posts);

If you know JavaScript, you already know Scriba.


📄 License

MIT Use freely, modify freely.