Skip to content

This module allows you to create an easy-to-use and instantly modifiable local database in JSON format.

License

Notifications You must be signed in to change notification settings

mehmetgenc-devs/jsondb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON DATABASE

EN: This module allows you to create an easy-to-use and instantly modifiable local database in JSON format.
TR: Bu modül, JSON formatında kullanımı kolay ve anlık değiştirilebilen yerel bir veritabanı oluşturmanıza olanak sağlar.


Usage

Install this module:
$ npm install @imehmetgenc/db.json

Import or require the module to your code:
const MegaDB = require('@imehmetgenc/db.json');
import MegaDB from '@imehmetgenc/db.json';

Test

EN: I have left a few tips for you to use below, I hope I explained them well.
TR: Aşağıda size kullanmanz için bir kaç ipucu bıraktım umarım iyi anlatmışımdır.


const newDb = new MegaDB("test"); // Create database src: /database/test.json

/*
const newDb = new MegaDB(); // Create database src: /database/database.json
const newDb = new MegaDB({ "name": "test", "folder": "database", "noBlankData": true, "readable": true }); // Create database src: /database/test.json
*/

newDb.set("database", "test"); // output: true, data: { "database" : "test" }

newDb.set("array", [1]); // output: true, data: { "array" : [1] }

newDb.push("array", 2); // output: true, data: { "array" : [1, 2] }

newDb.set("number", 1); // output: true, data: { "number" : 1 }

newDb.add("number", 2); // output: true, data: { "number" : 3 }

newDb.all() // output: { "database" : "test", "array" : [1, 2], "number" : 3 }

newDb.deleteAll() // output: true, data: {}

About

This module allows you to create an easy-to-use and instantly modifiable local database in JSON format.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published