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 🙏

© 2024 – Pkg Stats / Ryan Hefner

console.browser

v10.3.7

Published

Node.js doesn't show colors when it comes to logging/debugging. This package solves this problem and improves actual logging by adding a bunch of the other colors.

Downloads

22

Readme

How to use / import

First of all, install the package by using npm or yarn by tapping:

npm install console.browser --save
//or
yarn add console.browser

You only need to import the package by destructuring the module :

const { console } = require("console.browser");
console.nor("Hey");

This will return the console object with more colors

If you want to nest colors you can take/add an other variable in the destructuring:

const { console, colors } = require("console.browser");
console.warn(
	"Hey",
	colors.inverse("Inverse this!"),
	colors.rainbow("I'm a rainbow !!")
);

Members

nor ⇒

Equivalent to console.log but outputs the data in a blue tint to be more visible when logging information

Kind: global variable Returns: Data with a blue tinit

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

success ⇒

Outputs a success message to the console

Kind: global variable Returns: Data with green color

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.success("I just hacked Nasaaaaaaaaaaa !");

error ⇒

When debugging for example in a try{}catch{}

Kind: global variable Returns: Data with red color

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.error("OMG! I just did a stupid error!");

warn ⇒

Outputs a warning message to the console with a yellow color

Kind: global variable Returns: Data with yellow color

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.warn("The world will end in one week !");

info ⇒

Outputs an informational message to the console

Kind: global variable Returns: Data with dark blue color

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.info(
	"Did you know that Leonard de Vinci was born in 1452 in Anchiano ?"
);

rainbow ⇒

Outputs the multicolored data

Kind: global variable Returns: Rainbow output

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.rainbow(
	"The way I see it, if you want the rainbow, you gotta put up with the rain."
);

zebra ⇒

Outputs the data in black and white

Kind: global variable Returns: Zebra output

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.zebra(`Wait am i in savanna ?`);

bold ⇒

Outputs the data in bold

Kind: global variable Returns: Bold output

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.bold("I'm bold");

dim ⇒

Outputs the data in dim

Kind: global variable Returns: Dim output

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.dim("I'm a dim output !");

inverse ⇒

Outputs the inverse of the given data

Kind: global variable Returns: Inverse of the data

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.inverse("I'm a inverse output !");

italic ⇒

Outputs the data in italic

Kind: global variable Returns: Italic output

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.italic("I'm in italic !");

underline ⇒

Underlines the data

Kind: global variable Returns: Underlined output

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.underline("I'm underlined !");

allown ⇒

Isolates that given data to be more visible

Kind: global variable Returns: Isolated output

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.allown("This is isolated from the rest of the console");

newline ⇒

Shows each argument on a new line.

Kind: global variable Returns: Each argument on a new line

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.newline(
	"This is on the first line",
	"This is on the second line",
	"This is on the third line"
);

json ⇒

Shows each argument on a new line in a json format

Kind: global variable Returns: Each argument on a new line

| Param | Type | Description | | ------- | ---------------- | ------------------ | | ...args | any | The data to output |

Example

console.json(name, surname, username); //equivalent to writing console.log({name}, "\n", {surname}, "\n", {username})