npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

quantadb

v1.1.1

Published

Atmosoft quantadb a simple and very easliy to use database that relly change the new era

Downloads

14

Readme

Here’s a comprehensive README.md for quantadb, which includes setup instructions, usage examples, and detailed information about the database.

# quantadb

**quantadb** is a simple and unique file-based database for Node.js that supports CRUD operations with sequential integer IDs. It's designed to be easy to use and integrate into your projects, offering a lightweight solution for data storage and management.

## Features

- **Sequential Integer IDs**: Automatically generates and manages sequential integer IDs starting from 1.
- **File-Based Storage**: Stores data in custom `.xdb` files, making it easy to manage and backup.
- **CRUD Operations**: Supports Create, Read, Update, and Delete operations.
- **Lightweight and Simple**: No complex setup required; works directly with file-based storage.

## Installation

1. **Install the Package Locally**

   To install `quantadb` locally in your Node.js project, use the following command:

   ```bash
   npm install quantadb
  1. install for Development

    npm i quantadb

Usage

  1. Basic Setup

    Create a new instance of quantadb by specifying the directory where the database files will be stored.

    const quantadb = require('quantadb');
    const db = new quantadb('./db');
  2. Create a Document

    Create a new document in a specified collection.

    async function createUser() {
      const user = await db.create('users', { name: 'Alice', age: 25 });
      console.log('Created User:', user);
    }
  3. Read Documents

    Read documents from a collection with optional query parameters.

    async function readUsers() {
      const users = await db.read('users');
      console.log('Users:', users);
    }
  4. Update a Document

    Update an existing document by its ID.

    async function updateUser(id, updates) {
      const updatedUser = await db.update('users', id, updates);
      console.log('Updated User:', updatedUser);
    }
  5. Delete a Document

    Delete a document by its ID.

    async function deleteUser(id) {
      await db.delete('users', id);
      console.log('Deleted User with ID:', id);
    }

Example

Here's a complete example that demonstrates creating, reading, updating, and deleting documents:

example.js:

const quantadb = require('quantadb');

(async () => {
  const db = new quantadb('./db');

  // Create users
  const user1 = await db.create('users', { name: 'Alice', age: 25 });
  const user2 = await db.create('users', { name: 'Bob', age: 30 });

  // Read users
  console.log(await db.read('users'));

  // Update a user
  console.log(await db.update('users', user1.id, { age: 26 }));

  // Delete a user
  await db.delete('users', user2.id);

  // Read users again
  console.log(await db.read('users'));
})();

Project Structure

The quantadb project is structured as follows:

quantadb/
│
├── src/
│   ├── FileDatabase.js     # Core file-based database implementation
│
├── test/
│   ├── server.js           # Express server for testing
│   ├── public/
│   │   ├── index.html      # HTML file for the front-end
│   │   ├── style.css       # CSS file for styling
│   │   ├── script.js       # JavaScript file for front-end logic
│
├── package.json            # NPM package configuration
├── README.md               # Project documentation

Contributing

If you'd like to contribute to quantadb, please fork the repository and submit a pull request. Ensure that your code adheres to the coding style and includes appropriate tests.

License

quantadb is licensed under the MIT License.


This `README.md` provides an overview of `quantadb`, including installation instructions, usage examples, and details about the project structure. Adjust the email and contact details as necessary.