At home in your desktop app.
Integrate the Node SDK into your application lifecycle and packaging process.
Provide the runtime
BsonLite.cjs is a Node SDK, not a standalone EXE. A desktop application must supply a compatible Node runtime. The supported full-native distribution targets Windows x64, with an ordinary writable, access-controlled data location.
Electron supplies a Node-capable main process, but the application still needs correct executable paths and writable packaging locations. Real packaged Electron/installer testing remains pending; do not assume every bundler configuration is validated.
Keep database work in the backend
// Main process / local Node backend
const path = require('node:path');
const BsonLite = require('./BsonLite.cjs');
async function initialize(userDataDirectory) {
await BsonLite.connect({
name: 'myapp',
directory: path.join(userDataDirectory, 'Database')
});
}Pass your platform framework’s writable user-data directory to an initialization function like this. Keep the CJS and executable extraction behavior compatible with your application packaging. Expose only the specific validated operations the UI needs.
Coordinate startup and exit
- Await database connection before accepting application requests.
- Do not create competing instances for the same data directory.
- Stop request handling and await disconnect or handle.close on shutdown.
- Use encrypted backups for recovery rather than copying only the Database folder.
- Test app updates, crash recovery and the final installer on clean supported PCs.
The SDK tests cover the database wrapper and a Node starter. They are not a certification of your own Electron app, IPC authorization, installer or power-loss recovery behavior.
Documentation for BsonLite 0.6.0-rc.1. View SDK source · Download the validated SDK