One portable file Offline storage Native encryption

BsonLite

A portable MongoDB-based database for Node.js and Windows.
Store and query BSON documents locally, with native encryption.
One portable file. Automatic engine setup.

BsonLite, npm package & Console 0.3.0 →
my-next-idea / index.jsBsonLite.cjs
const BsonLite = require('bsonlite-sdk');

async function main() {
  await BsonLite.connect();

  const notes = BsonLite.collection('notes');
  // Your application starts here.
}

main().catch(console.error);
My little workspace
My notes3 records
Build something usefulKeep a good idea close.
Make room for offlineYour data, right here.
Find a better workflowA little less setup.
127.0.0.1automatic port

Illustrative app preview. BsonLite runs in your Node application.

Local engine. Secure connection. Your data.
Windows x64Node.js 20.19+No separate database install
CommonJS + ESMBSON & collectionsEncrypted live filesOffline by design
Prefer an npm package?

Install bsonlite-sdk.

The npm package brings BsonLite into your Node.js application. It uses the same connection and collection API as the standalone file.

Run npm i bsonlite-sdk in your project, then import the package and connect. The database engine is included.

View npm package ↗
powershell
npm i bsonlite-sdk
javascript
const BsonLite = require('bsonlite-sdk');

async function main() {
  await BsonLite.connect('myapp');
  // Start your application here.
}
main().catch(console.error);

Already using an older BsonLite database? Read the migration guide before upgrading.

Meet BsonLite Console

Your database.
A workspace of its own.

Browse collections, filter documents and run queries from BsonLite Console. Install the single .exe setup and open it from your desktop. A terminal CLI is available separately or in the combined bundle.

With the updated BsonLite, start your app, open Console and click Connect. Or enter your own connection URL.

BsonLite Console document browser and query console with synthetic demo records
A little less friction. A lot more building.

Your app should start.
Your database should just be there.

That’s the BsonLite idea.
One file.The BsonLite you add to your project
No extra install.The database engine comes along
Offline first.Your data stays close to your app
Keep the good parts. Simplify the setup.

Skip the setup stuff.

Spend your time on the thing you’re making.
BsonLite brings the local database pieces together,
so your application can get on with it.

One file. A lot less setup.

The custom engine, driver and connection lifecycle travel together. Your users don’t install a separate database.

my-next-idea/
BsonLite.cjs BsonLite
index.js
Database/ your data
javascript
const BsonLite = require('./BsonLite.cjs');
await BsonLite.connect();
Installation guide

Queries that feel familiar.

Collections, BSON values, indexes and aggregation. Use familiar syntax within the bundled engine profile.

notes collection
Build something useful open
Make it work offline open
Find a better workflow done
javascript
const notes = await BsonLite.collection('notes')
  .find({ done: false }).toArray();
Explore collections

Encryption comes along.

Live database files and temporary spills are encrypted by the custom native storage engine.

Your data, encrypted.
XChaCha20-Poly1305 · native storage
javascript
// Encryption is prepared automatically.
await BsonLite.connect();
How protection works

A connection of its own.

BsonLite selects a local port and prepares certificates and credentials behind the scenes.

Local connection illustration
Host127.0.0.1
Portautomatic
AuthenticationmTLS + SCRAM
javascript
await BsonLite.connect();
const state = BsonLite.status();
Connection lifecycle

A store that stays close.

Keep application data in your project’s Database folder. The runtime and protected vault live outside it.

Database/Encrypted live files
Runtime + key vaultprivate app data
javascript
// No server address to configure.
await BsonLite.connect();
Files and storage

Back up. Bring it back.

Create a password-protected backup of a stopped store, then restore to a new location.

MyApp.backupEncrypted backup archive
A separate password. A recovery plan.
javascript
// Close the store before creating a backup.
await BsonLite.disconnect();
Backup and restore
A familiar language for your ideas

Your queries. Your way.

Write familiar document queries.
Let BsonLite take care of the local setup.

javascript
const users = BsonLite.collection('users');

const makers = await users
  .find({ role: 'maker', active: true })
  .sort({ name: 1 })
  .toArray();
Illustrative output

Find matching records

[
  {
    "name": "Alex",
    "role": "maker",
    "active": true
  },
  {
    "name": "Maya",
    "role": "maker",
    "active": true
  }
]

Sample records only. Run the code in Node.js with BsonLite connected.

From idea to first connection

Three little steps.
Then it’s your turn.

01

Add BsonLite.

Install the package in your Node.js project.

npm i bsonlite-sdk
02

Make the connection.

One awaited call prepares the engine and its secure local connection.

await BsonLite.connect();
03

Build your thing.

Call a collection from your application modules and start working with data.

BsonLite.collection('notes')
Under the hood. In the open.

A small API.
The real details.

BsonLite on the outside.
A familiar engine underneath.

BsonLite uses a custom MongoDB 9.0.4 engine, so you can use the document queries, indexes and aggregation operators supported by that version and its standalone configuration. BsonLite is an independent project, not an official MongoDB product. The BsonLite manages encryption, connections, backup, migration and shutdown.

Understand the security model
  • Encrypted live storageDatabase blocks, journals and temporary spills.
  • Authenticated local accessAutomatic loopback port, mTLS and rotating credentials.
  • A protected key per storeWindows DPAPI CurrentUser protects the vault.

The engine profile0.7.0-alpha.0

MongoDB engine4.0.28 · custom native build
Node.js driver7.7.0
Storage engineWiredTiger 12
Native encryptionlibsodium 1.0.22
BsonLite version0.7.0-alpha.0
Built-in protection
Live filesXChaCha20-Poly1305
Local connectionsMutual TLS + SCRAM-SHA-256
Store keysWindows DPAPI CurrentUser

The modern database is experimental, with a defined engine profile and remaining production validation. Read the exact profile →

A few good questions

Glad you
asked.

The important details,
without a scavenger hunt.

Still curious? Say hello

No. The validated CJS embeds the custom engine and required JavaScript dependencies. Your application still needs Node.js 20.19+ or a compatible packaged runtime.

The distribution is a single BsonLite file, but its architecture is different. BsonLite starts a separate, authenticated local MongoDB engine. The executable is extracted into private application data.

By default, in ./Database inside your project’s working directory. The protected key vault, extracted engine and temporary TLS sessions stay outside the project in private Windows application data.

Document queries, BSON types, indexes and aggregation follow the bundled 9.0.4 standalone engine profile. Server-side JavaScript, replica-set transactions, change streams and Atlas-only services are outside this configuration.

Use an encrypted backup and its password with the matching Windows architecture and engine profile. Copying Database alone does not copy its account-bound data key. Cross-PC restore still requires field validation.

The modern 0.7.0-alpha.0 build passed the required native Windows checks. It remains experimental: clean desktop hardware, target-application testing, power-loss/disk-full behavior and independent security review remain additional work.
Made by Atik. Open to everyone.

Bring your questions and ideas.

Join Discord or contribute to the BsonLite core, npm package and Console.

Ready to build something?

Keep your data close. Give your next idea a little room.

await BsonLite.connect();
One portable file. A whole lot of possibility.
Support independent development

Help BsonLite keep growing.

If BsonLite helps your work, you can support development, testing and documentation with a coffee. Contributions are optional.

Buy me a coffee

buymeacoffee.com/bsonlite

Scan to support BsonLite on Buy Me a Coffee
Scan to support BsonLite