kve
v0.2.0
Published
Setup better Runkit custom value viewers.
Downloads
8
Maintainers
Readme
Kve
Kve (pronounced Kay-vee) lets you create better Runkit custom value viewers.
Improvements
- Custom viewer is made non-enumerable.
- The lowercase
html
key can be set instead ofHTML
. - Fetching and setting the symbol is done automatically.
- Allows for mutating the object or returning a new one.
- The html and title can be set to a function which returns a computed value.
Install
npm install kve
Usage
const kve = require("kve");
kve(
{ a: 1, b: 2, c: 3 },
{
title: "Some Viewer",
html: obj =>
Object.entries(obj)
.map(([name, value]) => `${name}: ${value}`)
.join("<br>")
}
);
Output
API
kve(object, options)
object
Type: object
The object to modify.
options
Type: object
html
Type: string | function
The HTML of the value viewer.
title
Type: string | function
The title of the value viewer.
mutate
Type: boolean
Default: false
Mutate the provided object.