
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
A lightweight, simple binary database for Node.js applications. SimpleBDB uses MsgPack encoding for efficient storage and fast access, making it perfect for small to medium-sized projects.
A lightweight, simple binary database for Node.js applications. SimpleBDB uses MsgPack encoding for efficient storage and fast access, making it perfect for small to medium-sized projects.
npm install simple-bdb
# or
yarn add simple-bdb
// Import the database
const SimpleBDB = require('simple-bdb');
// or with ES modules
import SimpleBDB from 'simple-bdb';
// Create a new database instance
const db = new SimpleBDB({ filePath: './data/mydb.bdb' });
// Set a value
db.set('user.name', 'John');
// Get a value
const name = db.get('user.name'); // Returns 'John'
// Check if a key exists
const hasAge = db.has('user.age'); // Returns false
// Delete a key
db.delete('user.name'); // Returns true
// Add to a number
db.set('counter', 10);
db.add('counter', 5); // counter is now 15
// Subtract from a number
db.subtract('counter', 3); // counter is now 12
// Push to an array
db.set('users', ['Alice']);
db.push('users', 'Bob'); // users is now ['Alice', 'Bob']
// Remove elements from an array
db.pull('users', user => user === 'Alice'); // users is now ['Bob']
// Get all data
const allData = db.all();
// Returns: [{ ID: 'user', data: { name: 'John' }}, { ID: 'counter', data: 12 }]
// Clear database
db.clear();
new SimpleBDB(options)
Options:
filePath (string, optional): Path to the database file. Default: 'database.bdb'autoSave (boolean, optional): Whether to automatically save changes. Default: truecachedData (boolean, optional): Whether to cache data for making less read request to your os. Default: trueset(key, value)Sets a value in the database.
get(key, defaultValue = null)Gets a value from the database.
has(key)Checks if a key exists.
delete(key)Deletes a key from the database.
add(key, amount)Adds a number to a value.
subtract(key, amount)Subtracts a number from a value.
push(key, value)Pushes a value to an array.
pull(key, callback)Removes elements from an array using a filter function.
all()Gets all data from the database.
save()Manually saves data to the database file.
clear()Clears all data from the database.
FAQs
A lightweight, simple binary database for Node.js applications. SimpleBDB uses MsgPack encoding for efficient storage and fast access, making it perfect for small to medium-sized projects.
We found that simple-bdb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.