1.1.5 • Published 4 years ago
alidb v1.1.5
AliDB
A Key-Value Pair script to save some data in a file as Json and get it back later.
Installation
npm i alidb
Usage
import AliDB from 'alidb'
const db = new AliDB()
// Give it a name.
db.init('MyDB')
// Put any type of data.
db.put('Name', 'Ali')
db.put('MyObj', { a: 'x', b: 'y' })
// Get the data back.
console.log( db.get('Name') )
// Erase DB content.
db.erase()
// Get all data as JSON.
console.log( db.getDBData() )
// Get all IDs.
console.log( db.getAllItems() )
Note
This package is for experience and for fun; not meant for real usage.