Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mehmetgenc-devs/jsondb
This module allows you to create an easy-to-use and instantly modifiable local database in JSON format.
https://github.com/mehmetgenc-devs/jsondb
database database-connector database-management database-schema databases db json json-data jsondb
Last synced: 3 months ago
JSON representation
This module allows you to create an easy-to-use and instantly modifiable local database in JSON format.
- Host: GitHub
- URL: https://github.com/mehmetgenc-devs/jsondb
- Owner: mehmetgenc-devs
- License: mit
- Created: 2023-11-02T15:05:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-25T02:15:13.000Z (5 months ago)
- Last Synced: 2024-09-13T09:25:53.777Z (4 months ago)
- Topics: database, database-connector, database-management, database-schema, databases, db, json, json-data, jsondb
- Language: JavaScript
- Homepage: https://mehmetgenc.dev
- Size: 62.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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:```bash
$ npm install @imehmetgenc/db.json
```
Import or require the module to your code:```js
const MegaDB = require('@imehmetgenc/db.json');
``````js
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.
```js
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: {}
```