简单的键值存储库
下载安装~ npm install --save[-dev] mkv# or ~ yarn add [--dev] mkvAPImkv.set(key:string,value:any,readonly:boolean=false)import mkv from "mkv" mkv.set("hello", "hello world") // string// -> hello worldmkv.set("options", { a: 1, b: 2, c: 3}) // object// -> { a: 1, b: 2, c: 3}) // set readonly data.mkv.set("readonly", 1, true);// -> 1mkv.set("readonly", 2)// throw TypeErrormkv.get(key:string)// in other files.import mkv from "mkv" mkv.get("hello")// -> hello worldmkv.get("options")// -> {a: 1, b: 2, c: 3}mkv.has(key:string)// in other files.import mkv from "mkv" mkv.has("hello")// -> truemkv.get("hello2")// -> falsemkv.delete(key:string)// in other files.import mkv from "mkv" mkv.delete("hello")// -> truemkv.get("hello")// -> undefined点击空白处退出提示
评论