简单的键值存储库 node-mkv

码农软件 · 软件分类 · Node.js 扩展 · 2019-04-13 23:28:51

软件介绍

简单的键值存储库

下载安装

~ npm install --save[-dev] mkv
# or 
~ yarn add [--dev] mkv

API

mkv.set(key:string, value:any, readonly:boolean = false)

import mkv from "mkv"
 
mkv.set("hello", "hello world") // string
// -> hello world
mkv.set("options", { a: 1, b: 2, c: 3}) // object
// -> { a: 1, b: 2, c: 3})
 
// set readonly data.
mkv.set("readonly", 1, true);
// -> 1
mkv.set("readonly", 2)
// throw TypeError

mkv.get(key:string)

// in other files.
import mkv from "mkv"
 
mkv.get("hello")
// -> hello world
mkv.get("options")
// -> {a: 1, b: 2, c: 3}

mkv.has(key:string)

// in other files.
import mkv from "mkv"
 
mkv.has("hello")
// -> true
mkv.get("hello2")
// -> false

mkv.delete(key:string)

// in other files.
import mkv from "mkv"
 
mkv.delete("hello")
// -> true
mkv.get("hello")
// -> undefined

本文地址:https://www.codercto.com/soft/d/3530.html

Don't Make Me Think

Don't Make Me Think

Steve Krug / New Riders Press / 18 August, 2005 / $35.00

Five years and more than 100,000 copies after it was first published, it's hard to imagine anyone working in Web design who hasn't read Steve Krug's "instant classic" on Web usability, but people are ......一起来看看 《Don't Make Me Think》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具