npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

yves

v1.1.3

Published

a customizable value inspector

Downloads

1,470

Readme

yves

A customizable value inspector for Node.js, inspired by eyes.

Handles circular objects, pretty-prints object literals, and supports ANSI color output, HTML output, and debug integration.

Install

npm install yves

Requires Node.js >= 18.

Usage

import yves from 'yves'

yves.inspect(something)

With a label:

yves.inspect(something, 'my value')

With a custom inspector:

const inspect = yves.inspector({ styles: { all: 'magenta' } })

inspect(something)

To return the string instead of printing to stdout:

const inspect = yves.inspector({ stream: null })

console.log(inspect({ something: 42 }))

Options

Pass options to inspector() or as the third argument to inspect().

Styles

styles: {
    all:     'cyan',      // Overall style applied to everything
    label:   'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]`
    other:   'inverted',  // Objects without a literal representation (functions)
    key:     'bold',      // Object keys, like 'a' in `{a: 1}`
    special: 'grey',      // null, undefined
    string:  'green',
    number:  'magenta',
    bool:    'blue',
    regexp:  'green',
}

Available styles: bold, underline, inverse, cyan, magenta, blue, yellow, green, red, grey.

Set styles: false to disable all styling. Set colors: false to disable ANSI codes.

Formatting

| Option | Default | Description | |--------|---------|-------------| | pretty | true | Indent object literals and arrays | | indent | 4 | Spaces per indentation level | | singleLineMax | 2 | Max keys before an object is printed multiline | | trailingComma | true | Add trailing commas in multiline output | | templateStrings | true | Use backtick syntax for strings containing newlines/tabs | | escape | true | Escape invisible characters in strings | | json | false | Use JSON-style output (double-quoted keys and strings) | | sortKeys | false | Sort object keys alphabetically | | sorted | false | Deep-sort the input object before inspecting |

Truncation

| Option | Default | Description | |--------|---------|-------------| | maxLength | -1 | Max output length in characters (-1 for unlimited) | | maxStringLength | - | Truncate strings beyond this length | | maxArrayLength | - | Show at most N array elements | | maxObjectKeys | - | Show at most N object keys |

Filtering

| Option | Default | Description | |--------|---------|-------------| | includes | null | Only show keys matching these strings/regexps | | excludes | null | Hide keys matching these strings/regexps | | obfuscates | null | Replace values of matching keys with <<obfuscated>> | | hideFunctions | false | Omit function-valued properties |

yves.inspect(obj, 'filtered', {
    includes: ['name', /^user/],
    obfuscates: ['password', /secret/],
})

Output

| Option | Default | Description | |--------|---------|-------------| | stream | process.stdout | Writable stream, or null to return the string | | colors | auto-detected | Enable ANSI color codes | | html | false | Output HTML <span> tags instead of ANSI codes | | decycle | true | Safely handle circular references |

HTML output

const inspect = yves.inspector({ stream: null, html: true, colors: true })

const html = inspect({ hello: 'world' })
// Returns a <pre> block with <span> color styling

Debug integration

yves integrates with the debug module. Use the %y formatter for compact output or %Y for sorted, function-free output:

import debug from 'debug'
const log = debug('app')

log('user data: %y', userData)

Console hijacking

Replace console.log / console.dir etc. with yves-powered output routed through debug:

yves.console('myapp')

console.log('hello')   // now outputs via debug('myapp:console:log')
console.dir({ a: 1 })  // pretty-printed via yves

yves.console_unset()   // restore original console

API

  • yves.inspect(obj, label?, options?) -- inspect and print to stream
  • yves.inspector(options?) -- returns a reusable inspect function
  • yves.options(opts) -- update global defaults
  • yves.stylize(str, style, options) -- apply a single ANSI/HTML style
  • yves.typeOf(value) -- enhanced typeof (distinguishes array, regexp, date, buffer, null, bigint)
  • yves.debugger(namespace) -- create a debug logger
  • yves.console(namespace?) -- hijack console with debug-powered output
  • yves.console_unset() -- restore original console methods

License

MIT