@suni29/jsdb

1.0.3 • Public • Published

What is JSDB?

JSDB is a Databse module for NodeJS made by Suni29, its easy to use & has a lot of features.

How to use JSDB?

Here is some code examples how to use it.

const Database = require('@suni29/jsdb')
const db = new Database('./db.json');

db.set('key', 'value')
db.get('key') // 'value'

db.add('counter', 10)
db.get('counter') // 10

db.substract('counter', 7)
db.get('counter') // 3

db.delete('counter')
db.get('counter') // undefined

db.has('key') // true

db.list() // Returns a stringified JSON text, ex.: "{"key":"value"}"

Options

There is not much options currently but in the future I will add more.

const Database = require('@suni29/jsdb')
const db = new Database('./db.json', {
  debug: true / false // Turns on or off the debug log in the console.
});

Installation

The installation process is very easy, just one command.

$ npm i @suni29/jsdb

Contact

You can contact me on Discord, Suni29#3946 or join Bitty's Support server to DM me.

Readme

Keywords

Package Sidebar

Install

npm i @suni29/jsdb

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

8.24 kB

Total Files

4

Last publish

Collaborators

  • suni29