0.1.3 • Published 12 months ago
@eggsnham07/simple-db v0.1.3
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
- disableSafeShutdown:
- disableDbRestore:
boolean
- disableDbRestore:
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