You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

bsonicdb

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bsonicdb

=========

1.1.92
latest
npmnpm
Version published
Weekly downloads
15
-50%
Maintainers
0
Weekly downloads
 
Created
Source

BsonicDB

=========

BsonicDB is a lightweight, high-performance, caching-based NoSQL database designed for efficient read and write operations. This database is optimized for both small and large data sets and supports various essential database operations like insert, update, find, and delete.

Features

  • Fast read/write performance.
  • Efficient in-memory caching with configurable durations.
  • Supports inserting, updating, deleting, and finding documents.
  • Bulk insert operations (insertMany).
  • Easily integrated into Node.js applications.

Installation

To install BsonicDB, run the following command:

npm install bsonicdb

Usage

Here's an example of how to use BsonicDB:

const BsonicDB = require('bsonicdb');

// Initialize the database with path and caching options
const db = new BsonicDB({
  path: './data',
  cacheDuration: 100, // Caches data for 100 milliseconds before writing to disk
});

// Initialize the database
db.initialize().then(async () => {
  console.log('BsonicDB Initialized!');

  // Insert a document into a collection
  await db.insert('users', { name: 'John', age: 30 });

  // Insert multiple documents into a collection
  await db.insertMany('users', [
    { name: 'Alice', age: 25 },
    { name: 'Bob', age: 28 }
  ]);

  // Find documents in a collection
  const allUsers = await db.find('users', {});
  console.log('All Users:', allUsers);

  // Find specific documents with a query
  const youngUsers = await db.find('users', { age: { $lt: 30 } });
  console.log('Young Users:', youngUsers);

  // Update a document
  await db.update('users', { name: 'John' }, { age: 31 });

  // Delete a document
  await db.delete('users', { name: 'Bob' });

  // Clear the entire collection
  await db.clear('users');
});

Keywords

nextDB

FAQs

Package last updated on 05 Mar 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.