Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

kve

Richienb3MIT0.2.0TypeScript support: included

Setup better Runkit custom value viewers.

runkit, value-viewer, check, value, viewer, repl, demo, extra, extends, html, display

readme

Kve Travis CI Build Status

Kve (pronounced Kay-vee) lets you create better Runkit custom value viewers.

NPM Badge

Improvements

  • Custom viewer is made non-enumerable.
  • The lowercase html key can be set instead of HTML.
  • 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

Example 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.