same.db
v1.0.1
Published
A simple local database
Readme
SAME.DB
A simple local database
What's new?
For now nothing being the first version :)
How To Use?
First of all we import the package!
const { Database } = require("same.db");
const db = new Database();Ok well now here are all the methods!
db.set(key, value)
db.get(key)
db.has(key)
db.all()
db.delete(key)
db.clear()
db.deleteAll()
db.push(key, element)
db.add(key, number)
db.fetchAll()
db.subtract(key, count)
db.sub(key, count)Ok now here are some examples!
db.add('joe_salary', 1380);var joe = db.has('joe_salary');
console.log(joe)db.set('frank_work', "manager")db.set('level', { difficulty: 'hard' })You Can Also Use Yarn Or Json (Json is in the base db)
const { Json } = require("same.db");
const db = new Json();const { Yarn } = require("same.db");
const db = new Yarn();