A persistent JSON database with the Map interface, built on NeDB.
JavaScript
NeDB-Map
JSON persistent storage with the familiar Map functionality, built on NeDB.
Getting started
constNeDBMap=require("nedb-map");constdb=newNeDBMap({filename: "yourdatabase.json"});// If you want to know when it's ready, usually not needed though.db.on("ready",()=>{// do stuff});/** * set, get, has, delete and clear all return promises. * * Keys must be strings, values can be anything. */(async()=>{awaitdb.set("key","Your value");// orawaitdb.set("anotherkey",{key: "a value"})// orawaitdb.set("yetanother",["array","of","things"]);/** * You can update a key by using `set`. */awaitdb.set("key","a different value");// check for existanceconstexists=db.has("key");// true// still with familiar syntaxconstretrievedValue=awaitdb.get("key");// get multiple keys at onceconst{ listof, manykeys }=awaitdb.getMany(["listof","manykeys"]);// delete a keypairawaitdb.delete("listof");// clear _all_ entries. this will not prompt you. it will take effect immediately.// be 100% sure before using this.awaitdb.clear();})();