npm.io
0.1.3 • Published 3 years ago

@eggsnham07/simple-db

Licence
MIT
Version
0.1.3
Deps
1
Size
19 kB
Vulns
0
Weekly
0

How to use:

First you must create the database

const Database = require("@eggsnham07/simple-db");
const db = new Database(<dbName>);

Database has 2 parameters, both are optional:

  • dbName: string
  • opts:
    • disableSafeShutdown: boolean
    • disableDbRestore: boolean

Setting database items

db.set(key: string, value: any) -> void

Example:

db.set("user_count", 135);
Getting database items
db.get(key: string) -> any

Example

console.log(db.get("user_count"));

Output: 135