Skip to content

gtjman/myeasy.db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Easy Db

An Easy To Use JSON File Database


installation:

npm i easy.db
yarn add myeasy-.db

Import

const { JSONDatabase } = require('myeasy-db');
      //or
import { JSONDatabase } from 'myeasy-db';
      
      const db = new JSONDatabase({
       file: 'myDatabase.json',
        JSONbeautifier: true
      })

Methods

db.get("") //Get data value from the database by the data id

db.fetch("") //Get data value from the database by the data id

db.find("") //Get data value from the database by the data id

db.update("", "") // Update a data value from the database (if there is no data a new data will be created)

db.set("", "") // Update a data value from the database (if there is no data a new data will be created)

db.delete("") // Delete a data from the database by data id

db.remove("") // Delete a data from the database by data id

db.add("", "") // Increase a data number value in the database

db.minus("", "") // Decrease a data number value in the database

db.subtract("", "") // Decrease a data number value in the database

db.push("", "") // This function is like the array push function in JavaScript, It adds one item to an array in the database

db.has("") // Check if there is a data in the database with a specific id

db.fetchAll("") // Get all data from the database

db.getAll("") // Get all data from the database

db.findAll("") // Get all data from the database

db.all() // Get all data from the database in a array

This package was just a challenge, i finished it in 1.23 hours.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published