Package Exports
- dev-database
- dev-database/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dev-database) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Dev-Database
A Lightweight JSON File-Based Database for Development
Overview
'Dev-Database' is a simple npm package that provides a straightforward way to perform database operations using JSON files. It's designed to be lightweight and suitable for small-scale development projects, making it easy to store and retrieve data.
Installation
To use 'Dev-Database' in your project, install it using npm:
npm install dev-databaseGetting Started
Create an instance of 'DevDatabase' by providing the path to your JSON file. Here's a quick example:
const DevDatabase = require('dev-database');
// Create an instance of DevDatabase with the file path
const db = new DevDatabase('database.json');
// Example usage
db.setData('key1', 'value1');
console.log(db.getData('key1')); // Output: 'value1'Methods
'setData(key, value)' Set a key-value pair in the database.
db.setData('key', 'value');'getData(key)' Retrieve the value associated with a key from the database.
const value = db.getData('key');'deleteData(key)' Delete a key-value pair from the database.
db.deleteData('key');Warning!
If the JSON file doesn't exist initially, the package will create an empty database.
Contact Me/Need Help?
Contact me in my Discord Developers Server https://discord.gg/Ym5V2DB6sk .

