1.0.2 • Published 8 months ago

pro.db-mega v1.0.2

Weekly downloads
-
License
CC BY-NC-ND 4.0
Repository
github
Last release
8 months ago

What is pro.db-mega ?

Installation

  • You need to install the package on your project
npm install pro.db-mega
yarn add pro.db-mega

Important Alert ⚠

  • The primary secret key is not secure. It is preferable to choose your own secret key

How To Use

const {DB} = require('pro.db-mega');

const db = new DB({fileName: `database.json`})

await db.set('key','value');// to set a data to database.
await db.get('key');// to get the data by key.
await db.delete('key');// to delete key from database.
await db.has('key','value');// return "true" or "false".

await db.setEncrypted('key','value','code');// to set a data to database. but its Encrypted 
await db.setEncrypted('key','code');// to get the Encrypted data by key.


await db.add('key', 10;);// to add a number to the key.
await db.substract('key', 5);// to subtract a number from the key.
await db.push('key', 10);// to set a data at the end.
await db.math("key","+",5);// to math the numbers.

await db.fetch(); // to fetch the data from database. 
await db.fetchAll();// to fetchAll data.
await db.all();// to get all data in database.

await db.backup("Filename");// to make a backup file.
await db.reset();// to delete all data and database.

await connect("mongoose URL") //Connect mongoose db 
await addMon('key','value')// to set a data to mongoose database.
await getMon('key')// to get the data by key from mongoose db.
await deleteOneMon('key')// to delete key from mongoose database.
await deleteAllMon() // to delete all data and mongoose database.

generateSecretKey() //Gives you a new random secret key

Contact

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago