
Security News
PyPI Expands Trusted Publishing to GitLab Self-Managed as Adoption Passes 25 Percent
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads
a customizable value inspector for Node.js
I was tired of looking at cluttered output in the console -- something needed to be done,
sys.inspect() didn't display regexps correctly, and was too verbose, and I had an hour or two to spare.
So I decided to have some fun. eyes were born.

example of the output of a user-customized eyes.js inspector
eyes also deals with circular objects in an intelligent way, and can pretty-print object literals.
var inspect = require('eyes').inspector({styles: {all: 'magenta'}});
inspect(something); // inspect with the settings passed to `inspector`
or
var eyes = require('eyes');
eyes.inspect(something); // inspect with the default settings
you can pass a label to inspect(), to keep track of your inspections:
eyes.inspect(something, "a random value");
If you want to return the output of eyes without printing it, you can set it up this way:
var inspect = require('eyes').inspector({ stream: null });
sys.puts(inspect({ something: 42 }));
These are the default styles and settings used by eyes.
styles: { // Styles applied to stdout
all: 'cyan', // Overall style applied to everything
label: 'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]`
other: 'inverted', // Objects which don't have a literal representation, such as functions
key: 'bold', // The keys in object literals, like 'a' in `{a: 1}`
special: 'grey', // null, undefined...
string: 'green',
number: 'magenta',
bool: 'blue', // true false
regexp: 'green', // /\d+/
},
pretty: true, // Indent object literals
hideFunctions: false, // Don't output functions at all
stream: process.stdout, // Stream to write to, or null
maxLength: 2048 // Truncate output if longer
You can overwrite them with your own, by passing a similar object to inspector() or inspect().
var inspect = require('eyes').inspector({
styles: {
all: 'magenta',
special: 'bold'
},
maxLength: 512
});
The 'util' module is a built-in Node.js module that provides various utilities, including the 'util.inspect' function, which can be used to inspect objects. While 'util.inspect' is more basic and lacks the colorful output of 'eyes', it is a standard part of Node.js and does not require an additional package.
The 'prettyjson' package is another tool for formatting JSON and JavaScript objects in a human-readable way. It provides colorful output similar to 'eyes', but focuses more on JSON data. It is a good alternative if you are primarily working with JSON.
The 'cli-color' package provides a way to add color to console output in Node.js. While it does not specifically format objects, it can be used in conjunction with other tools to create colorful console outputs, similar to what 'eyes' offers.
FAQs
a customizable value inspector
The npm package eyes receives a total of 1,833,069 weekly downloads. As such, eyes popularity was classified as popular.
We found that eyes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.