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

javascript-console-styling

v1.1.1

Published

A package made specifically for providing you with all the javascript console colors and styles you'll ever need as simple functions!

Downloads

20

Readme

Features

This package comes with all available console styling escape codes in the form of functions, which allows for features that console-styling does not provide such as nesting colors and/or decorations. This package also provides a main.js file that can be used to easily test out all the functions and their output in different environments.

Colors

Black, Black Background, Red, Red Background, Green, Green Background, Yellow, Yellow Background, Blue, Blue Background, Magenta, Magenta Background, Cyan, Cyan Background, White, White Background, Gray, Gray Background, Bright Red, Bright Red Background, Bright Green, Bright Green Background, Bright Yellow, Bright Yellow Background, Bright Blue, Bright Blue Background, Bright Magenta, Bright Magenta Background, Bright Cyan, Bright Cyan Background, Bright White, Bright White Background

All available colours

Decorations

Bright, Dim, Italic Not widely supported, Underline, SlowBlink, RapidBlink Not widely supported, Reverse Not widely supported, Hidden Not widely supported, Strikethrough Not supported by all terminals (mostly the Windows Terminal)

All available decorations, the eighth one is "hidden"

Combinations

You can obviously combined color styles and decorations together by nesting them:

All available decoration/colour style combinations

The first block of those two is hidden

Usage

Option 1: Import all the colors and decorations

You can import all the color styles and decorations together with the following code:

const JCS = require("javascript-console-styling");

You can also import the Colors and Decorations object with the following code:

const { Colors, Decorations } = require("javascript-console-styling");

And later use individual styles:

console.log(Colors.redBg(Decorations.underline("Hello, world!")));

or declare them on their own:

const redBg = Colors.redBg;
const underline = Decorations.underline;
console.log(redBg(underline("Hello, world!")));

Option 2: Import only the colors

If you only want to use the color styles, you can import them on their own with the following code:

const Colors = require("javascript-console-styling/Colors");

You can also import a specific color styling on its own with the following code:

const { red, magenta, cyanBg } = require("javascript-console-styling/Colors");

Option 3: Import only the decorations

If you only want to use the decorations, you can import them on their own with the following code:

const Decorations = require("javascript-console-styling/Decorations");

You can also import a specific decoration on its own with the following code:

const { bright, underline, strikethrough } = require("javascript-console-styling/Decorations");

Issues

You can file an issue on Github, your issue can be a suggestion or a bug report as long as it's not a duplicate and is detailed and concisely described.