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

pretty-dev

v1.1.0

Published

Pretty console output.

Readme

pretty-dev

npm version install size

Pretty prints the log message to the console with customizable styles.

Installation

You can install pretty-dev using npm:

npm install pretty-dev

How to use

In your JavaScript code, import the necessary modules:

const { Log, logStyle } = require('pretty-dev');

Create an instance of the Log class:

const log = new Log();

Set the text of the log message using the setText method:

log.setText('Message Text');

Apply styles to the log message using the style method and the predefined styles from logStyle:

log.style(logStyle.red).style(logStyle.backgroundGreen);

Print the formatted log message to the console using the print method:

log.print();

Retrieve the formatted log message as a string using the text method:

const formattedText = log.text();
console.log(formattedText);

Examples

Here are some examples of using the pretty-dev package:

// Printing formatted log message
log.setText('Message Text').style(logStyle.red).style(logStyle.backgroundGreen).print();

// Printing a styled greeting message
console.log('Hello ' + log.setText('Matija').style(logStyle.red).style(logStyle.bold).text() + '. Nice to meet you!');

// Printing an error message with bold red text on yellow background
log.setText('Error: File not found').style(logStyle.red).style(logStyle.bold).style(logStyle.backgroundYellow).print();

Styles

The pretty-dev package provides several predefined styles that you can apply to the log messages using the style method. Here are some of the available styles:

  • logStyle.black: Sets the text color to black.
  • logStyle.red: Sets the text color to red.
  • logStyle.green: Sets the text color to green.
  • logStyle.yellow: Sets the text color to yellow.
  • logStyle.blue: Sets the text color to blue.
  • logStyle.magenta: Sets the text color to magenta.
  • logStyle.cyan: Sets the text color to cyan.
  • logStyle.white: Sets the text color to white.
  • logStyle.backgroundBlack: Sets the background color to black.
  • logStyle.backgroundRed: Sets the background color to red.
  • logStyle.backgroundGreen: Sets the background color to green.
  • logStyle.backgroundYellow: Sets the background color to yellow.
  • logStyle.backgroundBlue: Sets the background color to blue.
  • logStyle.backgroundMagenta: Sets the background color to magenta.
  • logStyle.backgroundCyan: Sets the background color to cyan.
  • logStyle.backgroundWhite: Sets the background color to white.
  • logStyle.bold: Makes the text bold.
  • logStyle.italic: Makes the text italic.
  • logStyle.underline: Underlines the text.

You can combine multiple styles by chaining the style method calls.