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

@frankhoodbs/logging-utilities

v1.4.8

Published

A collection of utilities for logging

Downloads

392

Readme

@frankhoodbs/logging-utilities

A collection of utilities for logging crafted with love by Frankhood Business Solutions s.r.l..

Version License

Features

  • Pre-defined Emoji icons for expressive logging.
  • Flexible and themed logging with colorful outputs.
  • Extensible with custom themes.

Installation

Using npm:

npm install @frankhoodbs/logging-utilities

Usage

Import the Utility

import {
    colorLog,
    progressBar,
    zzz,
    ok,
    brain,
} from '@frankhoodbs/logging-utilities';

Basic Logging

colorLog({
    icon: zzz,
    label: 'INFO',
    message: 'This is a basic log message',
});

Component Screenshot

Progress Logging

const percentageCount = (fractionValue / totalValue) * 100;
const percentage = isNaN(percentageCount) ? 0 : percentageCount;
//we divide by 3 to make the bar a bit less wide
const barProportion = 3;
const done = parseInt(percentage / barProportion, 10);
const missing = 100 / barProportion - done;
const emptyOrFull = percentage === 0 || percentage === 100;
const label = `My custom label -> ${percentage.toFixed(
    0
)}% (${fractionValue} / ${totalValue})`;
const isLabelBeforeBar = false;

progressBar({
    done,
    missing,
    emptyOrFull,
    label,
    isLabelBeforeBar,
});

Component Screenshot

Themed Logging

colorLog({
    icon: brain,
    label: 'DEBUG',
    message: 'Using the vue theme',
    themeName: 'vue',
});

colorLog({
    icon: ok,
    label: 'SUCCESS',
    message: 'Using a custom theme',
    theme: {
        backgroundColorLeft: '#FF0000',
        backgroundColorRight: '#00FF00',
        colorLeft: '#FFFFFF',
        colorRight: '#000000',
    },
});

Component Screenshot

Status Logging

colorLog({
    label: 'REJECTED',
    message: 'A task is rejected',
    status: -1,
});
colorLog({
    label: 'PENDING',
    message: 'A task is pending',
    status: 0,
});
colorLog({
    label: 'PASSED',
    message: 'A task is passed',
    status: 1,
});

Component Screenshot

Available Icons

For your convenience, the following pre-defined icons are available:

  • zzz: 💤
  • bomb: 💣
  • prohibited: 🚫
  • ok: ✅
  • rightArrow: 💫
  • info: ℹ️
  • brain: 🧠
  • pop: 🎉
  • wait: ⏳
  • comet: ☄️
  • bell: 🔔

Certamente! Una delle maniere per farlo in un file README.md su GitHub è utilizzare badge colorati fatti con le righe di codice Markdown. Ecco un esempio di come potrebbe apparire:


Available Themes

The following themes are predefined and ready to use:

  • vue: #35494E #41B883
  • green: #41B883 #FFFFFF
  • orange: #5E3535 #ECA70A
  • purple: #a86cba #ddc9e4
  • purple2: #a86cba #ffffff
  • red: #9C7F3D #FF3311
  • red2: #5E3535 #FF3311
  • blue: #1F351E #1188FF
  • blue2: #1188FF #ffffff

Component Screenshot

However, you can also provide your own custom theme when logging.

License

This project is licensed under the ISC License.