Skip to content

Repository files navigation

AxioDB: SQLite Alternative for JavaScript

npm version npm version shields npm downloads total npm downloads yearly npm downloads weekly npm downloads monthly install size jsDelivr hits npm types License: MIT

Push to Registry CodeQL Socket Security GitHub Stars

Node.js Version Tested on Node.js TypeScript Zero Dependencies

👉 Official Documentation — axiodb.in: Full guides, API reference, and examples. This README is a quick start — see the site for everything else.


What is AxioDB?

Embedded NoSQL for Node.js, zero native deps. npm install axiodb and you have a database — no server, no node-gyp, no electron-rebuild.

Problem: better-sqlite3 needs compiled binaries, electron-rebuild on every Electron update, per-platform builds. Plain JSON files have no query/cache/index.

Solution: AxioDB is a file-based document database with ACID transactions and MongoDB-style queries on plain JavaScript objects.

const { AxioDB } = require('axiodb');
const db = new AxioDB({ GUI: true }); // Dashboard at http://localhost:27018
const users = await (await db.createDB('AppDB')).createCollection('users');

await users.insert({ name: 'Alice', age: 30 });
const { data } = await users.query({ age: { $gt: 25 } }).Sort({ age: -1 }).Limit(10).exec();
console.log(data.documents);

Objective

Great for: Electron, CLI tools, embedded systems, local-first apps, rapid prototyping.

Sweet spot: Local applications, desktop apps, CLI tools, and services that need a simple document database without a separate database server.

Not for: 10M+ docs, hundreds of concurrent users, JOINs, replication/sharding — use PostgreSQL/MongoDB.


Installation

npm install axiodb
# Node.js ≥20

Basic CRUD

CRUD means Create, Read, Update, and Delete. The following example creates a database and collection, then demonstrates each basic operation:

const { AxioDB } = require('axiodb');

const db = new AxioDB();
const database = await db.createDB('AppDB');
const users = await database.createCollection('users');

// Create: insert a document. AxioDB adds documentId and updatedAt automatically.
const created = await users.insert({ name: 'Alice', email: 'alice@example.com', age: 30 });
const userId = created.data.documentId;

// Read: query documents and execute the chainable reader.
const result = await users.query({ age: { $gte: 18 } }).exec();
console.log(result.data.documents);

// Update: update the first document matching the query.
await users.update({ documentId: userId }).UpdateOne({ age: 31 });

// Delete: delete the first document matching the query.
await users.delete({ documentId: userId }).deleteOne();

Use UpdateMany() or deleteMany() when the operation should affect every matching document. Updates are flat merges; MongoDB update operators such as $inc, $set, and $push are not supported.

Features

  • Zero native deps — pure JS, no node-gyp, no electron-rebuild
  • MongoDB-style queries{ age: { $gt: 25 } }, 19 operators + hint() + findByIds()
  • ACID transactionssavepoint/rollbackTo/WAL, crashes recover via Transaction.recoverTransactions()
  • Aggregation — 60+ stages, $lookup joins, OperatorRegistry custom ops
  • InMemoryCache + indexes — dual-write, auto IndexCache
  • Ports: GUI 27018 · TCP 27019 AxioDBCloud · MCP 27020 Docker-only

Docs: axiodb.in is the single source — this README is a quick start only.

  • AxioDBCloud (TCP) — remote AxioDBCloud client, 32 commands, optional TCPAuth + TLSaxiodb.in/cloud
  • CLI (Go)axiodb document insert/query --hint find-by-ids transaction begin/commit user change-password (HTTP 27018 for management, TCP 27019 for data) → axiodb.in/cli
  • Dockertheankansaha/axiodb AXIODB_GUI/TCP/MCP 27018/27019/27020axiodb.in/docker
  • MCP Server — 43 tools axiodb_loginsessionId + withConfirmation Docker/mcp/tools/*.jsaxiodb.in/mcp-server
  • GUI + RBACSuper Admin/Admin/View, mustChangePassword, LoginRateLimiteraxiodb.in/security
  • API & TypesDocument/src/data/serverApi.ts 41 endpoints openapi.json, TS 6.0 strict → axiodb.in/api-reference axiodb.in/server-api

Contributing, License & Support

Author: Ankan Saha · Docs: cd Document && npm run dev http://localhost:5173

About

SQLite Alternative for JavaScript — Embedded NoSQL for Node.js for local-first, Electron, CLI and prototyping. Zero native deps, no compilation.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

31 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages