Catalog npm
PACKAGE EXPLORERView in registry

0inspect

npm

Pretty string representation of object

colorinspectlogobjectprettystringstringifyutil
Versions collected2
Direct dependencies2From release 0.0.2
Last observed20 Oct, 17:41 UTC

README

Current package documentation

👀 0inspect

NPM version

Simple utility for displaying a pretty eye-friendly colorful representation of an object for inspection purposes 👮.

Screenshot

📥 Install

npm i 0inspect

🏁 Use

const inspect = require("0inspect");
// or const { inspect, log } = require("0inspect");

const objString = inspect(someObj);
console.log(objString);

// or shorter
inspect.log(someObj);

📕 API

inspect(obj?: Any, options?: Object);

  • obj: Any: Object to inspect.
  • options: Object: Options object.
    • depth: Number: Object nesting depth. Default: 10.

inspect.log(obj?: Any, options?: Object);

  • Just a wrapper for console.log(inspect(obj, options)).

🎨 Colors

ColorMeaning
GreenTruthy Primitive
RedFalsy Primitive
CyanFull Object
YellowEmpty Object
MagentaFunction

As this is using Chalk for console colors, the color support control is automatic, but you can still override it this way:

const chalk = require("chalk"); // Chalk v4.1.2
chalk.level = 0; // No color

💡 See: chalk # chalk.level

🔣 Symbols

SymbolMeaning
◆Truthy Primitive
◇Falsy Primitive
●Full Object
○Empty Object
◉Function
ØNo Class
→Value

💠 Examples

InputCategoryOutputOutput Color
1nTruthy Primitive◆ BigInt → 1Green
NaNFalsy Primitive◇ Number → NaNRed
undefinedFalsy Primitive◇ Ø → undefinedRed
{ a:"" }Full Object● Object → {1}Cyan
{}Empty Object○ Object → {}Yellow
() => ""Function◉ Function → (anonymous)()Magenta

📃 License

MIT © Ambratolm

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 2

Collected releases
VersionPublishedDirect dependenciesOpen version
0.0.2Registry latest1 Apr 20222
0.0.129 Mar 20222

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
simple-works/0inspect

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:41 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:fd3865ded8b0bab3c453db8abf4829d856ff4309f15ff0f6a8919519f30e9436