Skip to main content

JSONVault

JSON document storage that lives alongside your code. Build reactive apps, run analytics with SQL, and ship migrations without standing up a separate database.

Document-first

Store, query, and stream JSON documents without running a separate server. JSONVault keeps everything in inspectable files inside your repository.

Powerful tooling

Schemas, hooks, SQL with joins, migrations, a durable change log, and a CLI come included. No plugins required.

Ready for production

Field-level encryption, TTL indexes, partitioned storage, and transactions make it easy to build reliable workflows.

What does a JSONVault app look like?

A few lines let you open a database, attach a schema, and run queries using either filter objects or SQL with joins.

Explore the query guide
const { JsonDatabase, createSchema } = require("jsonvault");

async function main() {
  const db = await JsonDatabase.open({
    path: "./data",
    changeLog: { path: "./data/changelog.jsonl" },
  });

  const users = db.collection("users", {
    schema: createSchema({
      fields: {
        name: { type: "string", required: true },
        email: { type: "string", required: true,
                 transform: (v) => v.toLowerCase() },
      },
    }),
  });

  await users.insertOne({ name: "Ada", email: "ADA@example.com" });

  const results = await db.sql`
    SELECT users.email, orders.total
    FROM orders
    JOIN users ON orders.userId = users._id
    WHERE orders.total > 1000
  `;

  console.log(results);
}

main();

Ship faster with a database that stays in git

JSONVault keeps data in human-readable JSON, so snapshots, migrations, and audits all live alongside your application. No server to manage, no hidden state.