@darkkdev/dark.db
v1.0.0
Published
A simple JSON-based database package for Node.js, designed to provide easy key-value storage with automatic file persistence.
Readme
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 dark.dbUsage
Import and Initialize
const { Data, Driver } = require('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 Devdelete(key)
Deletes a key from the database.
db.delete('username');has(key)
Checks if a key exists.
console.log(db.has('username')); // Output: falsepush(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
