Neovictorian Paisley Menswear
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

kve

0.2.0 • Public • Published

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.

Install

npm i kve

DownloadsWeekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

4.5 kB

Total Files

6

Last publish

Collaborators

  • avatar