Quick Start
Requirements#
- Node.js 20.0.0 or higher (verify with
node --version) - npm 6.0.0 or higher (yarn 1.0.0+ optional)
- ~2MB disk space, zero external dependencies
Install#
npm install axiodb@latest --save1
Create an instance
const { AxioDB } = require('axiodb');
// Enable the built-in GUI at localhost:27018
const db = new AxioDB({ GUI: true });2
Create a database and collection
const myDB = await db.createDB('HelloWorldDB');
const collection = await myDB.createCollection('greetings');3
Insert and query
await collection.insert({ message: 'Hello, Developer! 👋' });
const result = await collection.query({}).exec();
console.log(result.data.documents[0].message);
// Hello, Developer! 👋Constructor options#
| Option | Type | Default | What it does |
|---|---|---|---|
GUI |
boolean | false |
Enables the web GUI on localhost:27018 |
RootName |
string | "AxioDB" |
Custom root folder name |
CustomPath |
string | current directory | Where database files are stored |
TCP |
boolean | false |
Enables the AxioDBCloud TCP server on port 27019 |
TCPAuth |
boolean | false |
Requires username/password on TCP connections (same RBAC as the GUI) |
Only one AxioDB instance is allowed per application — it's a singleton. Create it once, then open as many databases and collections as you need under it.