# @frankhoodbs/logging-utilities

> A collection of utilities for logging

Latest version **5.0.0** (published 2026-03-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install @frankhoodbs/logging-utilities
pnpm add @frankhoodbs/logging-utilities
yarn add @frankhoodbs/logging-utilities
bun add @frankhoodbs/logging-utilities
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2026-03-04 |
| First published | 2023-04-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Frankhood Business Solutions s.r.l. |
| Maintainers | giando110188, frankhood-info, skill83, m.brandonisio |

## Links

- npm: https://www.npmjs.com/package/@frankhoodbs/logging-utilities
- npm.io page: https://npm.io/package/@frankhoodbs/logging-utilities

## Recent versions

- 5.0.0 (latest) — 2026-03-04
- 4.0.2 — 2025-11-26
- 4.0.1 — 2025-11-12
- 4.0.0 — 2025-10-24
- 3.0.4 — 2025-07-17
- 3.0.3 — 2025-06-04
- 3.0.2 — 2025-05-27
- 3.0.1 — 2025-05-15
- 3.0.0 — 2025-04-24
- 2.0.3 — 2024-11-05
- 2.0.2 — 2024-10-01
- 2.0.1 — 2024-09-30
- 1.4.12 — 2024-09-25
- 1.4.11 — 2024-09-17
- 1.4.10 — 2024-07-15
- … 38 more at https://npm.io/package/@frankhoodbs/logging-utilities/versions

## README

# @frankhoodbs/logging-utilities

A collection of utilities for logging crafted with love by [Frankhood Business Solutions s.r.l.](https://www.frankhood.it/).

![Version](https://img.shields.io/npm/v/@frankhoodbs/logging-utilities)
![License](https://img.shields.io/npm/l/@frankhoodbs/logging-utilities)

## Features

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

## Installation

Using npm:

```bash
npm install @frankhoodbs/logging-utilities
```

## Usage

### Import the Utility

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

### Basic Logging

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

![Component Screenshot](https://i.imgur.com/MCX6zg1.png)

### Progress Logging

```javascript
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](https://i.imgur.com/eJap68E.png)

### Themed Logging

```javascript
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](https://i.imgur.com/KReC3NH.png)

### Status Logging

```javascript
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](https://i.imgur.com/CQ2UeWK.png)

## 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](https://via.placeholder.com/15/35494E/000000?text=+) ![#41B883](https://via.placeholder.com/15/41B883/000000?text=+)
-   **green**: ![#41B883](https://via.placeholder.com/15/41B883/000000?text=+) ![#FFFFFF](https://via.placeholder.com/15/FFFFFF/000000?text=+)
-   **orange**: ![#5E3535](https://via.placeholder.com/15/5E3535/000000?text=+) ![#ECA70A](https://via.placeholder.com/15/ECA70A/000000?text=+)
-   **purple**: ![#a86cba](https://via.placeholder.com/15/a86cba/000000?text=+) ![#ddc9e4](https://via.placeholder.com/15/ddc9e4/000000?text=+)
-   **purple2**: ![#a86cba](https://via.placeholder.com/15/a86cba/000000?text=+) ![#ffffff](https://via.placeholder.com/15/ffffff/000000?text=+)
-   **red**: ![#9C7F3D](https://via.placeholder.com/15/9C7F3D/000000?text=+) ![#FF3311](https://via.placeholder.com/15/FF3311/000000?text=+)
-   **red2**: ![#5E3535](https://via.placeholder.com/15/5E3535/000000?text=+) ![#FF3311](https://via.placeholder.com/15/FF3311/000000?text=+)
-   **blue**: ![#1F351E](https://via.placeholder.com/15/1F351E/000000?text=+) ![#1188FF](https://via.placeholder.com/15/1188FF/000000?text=+)
-   **blue2**: ![#1188FF](https://via.placeholder.com/15/1188FF/000000?text=+) ![#ffffff](https://via.placeholder.com/15/ffffff/000000?text=+)

![Component Screenshot](https://i.imgur.com/0OQgOZu.png)

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

## License

This project is licensed under the ISC License.

---
_Source: https://npm.io/package/@frankhoodbs/logging-utilities · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
