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

bootstrap-logs

v1.0.2

Published

bootstrap themed color console logs

Downloads

7

Readme

bootstrap-logs

Many developers are familiar with the bootstrap alert colors. This package brings that color coding familiarity to your console.

Based on the fantastic chalk package.

Why

I found myself using the console for newbie debugging and using tabs, new lines, asterisks, or many other things to organize the output into something readable. I learned about chalk and its amazing ability to add color to the command line. However, as a lazy developer (a good thing), I wanted to minimize typing and complexity as much as possible as well to streamline and generalize the creating of the colorful logs.

Install

$ npm install --save bootstrap-logs

Usage

There are five type of colored logs that can be created:

log("This is a normal line");

Prints the line without any colorization.

log.danger("Something bad has happened and you should be aware of it.");

Prints the line with a red background.

log.warning("Something significant requires your attention.");

Prints the line with a yellow background.

  log.info("These are details that you may want to know.");

Prints the line with a cyan background.

  log.success("This is a valid result! This show you got what you wanted.");

Prints the line with a green background.

example1

In a nutshell:

  • log(): No color. Handy for bulk or complimentary text.
  • log.danger(): Red. Useful to indicate errors and failures.
  • log.warning(): Yellow. Useful to indicate warnings or potential failures.
  • log.info(): Blue. Ideal to indicate key steps in a process or nice-to-knows.
  • log.success(): Green. Great for showing results or satisfactory completion of a task.

But wait, there is more!

You can customize your logs by adding an indicator in front of the string that is going to be logged by using the log.custom() function.

log.custom({
  danger : "[  ERROR  ] ",
  info   : "[  INFO   ] ",
  warning: "[ WARNING ] ",
  success: "[ SUCCESS ] ",
});

log.custom() takes an object with four properties (one for each of the log types). Each property takes a string as its value. The string is whatever you want to display before the log message. Using the example above, we would obtain the following logs:

example2

It gets even more fun! You could use emojis as part of your custom header!

log.custom({
  danger : `[ ${String.fromCodePoint(0x1F480)}  ]`,
  info   : `[ ${String.fromCodePoint(0x1F4DD)}  ]`,
  warning: `[ ${String.fromCodePoint(0x1F4E2)}  ]`,
  success: `[ ${String.fromCodePoint(0x2705)}  ]`,
});

Give us:

example3

You can find the full list of Code Points for emojis at the Unicode site.

I hope that you find this package fun and useful for your projects.

License

MIT © DecaHub by Darias