Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prettyoutput

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettyoutput

Librarie to format js/json objects into a YAML-style colored output. Especially useful to pretty print logs. Performant (benchmarks)

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is prettyoutput?

The prettyoutput npm package is designed to format and print JavaScript objects in a visually appealing and readable way. It is particularly useful for debugging and logging purposes, as it helps developers quickly understand the structure and content of complex objects.

What are prettyoutput's main functionalities?

Basic Object Formatting

This feature allows you to format a basic JavaScript object into a more readable string format. The code sample demonstrates how to use prettyoutput to print a simple object.

const prettyoutput = require('prettyoutput');
const obj = { name: 'John', age: 30, city: 'New York' };
console.log(prettyoutput(obj));

Nested Object Formatting

This feature handles the formatting of nested objects, making it easier to visualize the structure of more complex data. The code sample shows how prettyoutput can be used to print an object with nested properties.

const prettyoutput = require('prettyoutput');
const nestedObj = { person: { name: 'John', age: 30 }, address: { city: 'New York', zip: '10001' } };
console.log(prettyoutput(nestedObj));

Array Formatting

This feature formats arrays, including those containing objects and other arrays. The code sample demonstrates how prettyoutput can be used to print an array with mixed content.

const prettyoutput = require('prettyoutput');
const arr = [1, 2, { name: 'John', age: 30 }, [3, 4]];
console.log(prettyoutput(arr));

Other packages similar to prettyoutput

Keywords

FAQs

Package last updated on 10 Jan 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc