简单的键值存储库 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://codercto.com/soft/d/3530.html

Refactoring

Refactoring

Martin Fowler、Kent Beck、John Brant、William Opdyke、Don Roberts / Addison-Wesley Professional / 1999-7-8 / USD 64.99

Refactoring is about improving the design of existing code. It is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its int......一起来看看 《Refactoring》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具