@imehmetgenc/jsondb

0.0.1 • Public • Published

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.


Github: https://github.com/imehmetgenc/jsondb

Usage

Install this module:
$ npm install @imehmetgenc/jsondb

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

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: {}

Package Sidebar

Install

npm i @imehmetgenc/jsondb

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

13.2 kB

Total Files

6

Last publish

Collaborators

  • imehmetgenc