Skip to content

id5g/dark.db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dark.DB

A simple JSON-based database package for Node.js, designed to provide easy key-value storage with automatic file persistence.

Installation

npm install @darkkdev/dark.db

Usage

Import and Initialize

const { Data, Driver } = require('@darkkdev/dark.db');

const db = new Data({ driver: new Driver('database.json') });

Methods

set(key, value)

Stores a value in the database.

db.set('username', 'Dark Dev');

get(key)

Retrieves a value from the database.

console.log(db.get('username')); // Output: Dark Dev

delete(key)

Deletes a key from the database.

db.delete('username');

has(key)

Checks if a key exists.

console.log(db.has('username')); // Output: false

push(key, value)

Pushes a value into an array stored at the key.

db.push('users', 'user1');
console.log(db.get('users')); // Output: ['user1']

License

This project is licensed under the MIT License.

Developer

Github : Click Here Website : Click Here

Source

Github : Click Here

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors