NoDBStore
Simple database working on memory and can have multiple storage
it will be use for small data that need to be stored easily with a simple api
Getting started
npm i nodbstore
create the db
Only in memory
const nodbstore = // create a database (a simple table)const db =
insert an element
// O(1)const entry = db
edit an element
// O(1)const editedEntry = db
remove an element
// O(1)const deletedEntry = db
get an entry
// O(1)const gettedEntry = db
find an element
// O(n)// stop when it finded oneconst entry = db // start from the endconst entry = db // return null if it doesnt find something
find all entries
// O(n)// always return an arrayconst entries = db
export
// to JSON stringdb// to JS Object !! thats not a clone !db // if you want a clone :JSON
import
// from JSON stringdb// from exported db object !! it will edit directly the objectdb // wana work from a clonedb
add a storage
Storage { // trigger when some data are updated // you can add test if you want to skip write in some case if consolelog === undefined return thisnodb // the instance of the database console json === thisnodb // -> true } // can be omited { // called manuall or with nodb.loadFromStore( store ) thisnodb } // can be omited { // trigger when store is added to nodb thisdatathatIwilluselater = 'some' // or do WTFYW } db