PHPackages                             brzuchal/json-highlighter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. brzuchal/json-highlighter

ActiveLibrary[CLI &amp; Console](/categories/cli)

brzuchal/json-highlighter
=========================

A PHP library for syntax highlighting JSON in the terminal.

1.0.x-dev(1y ago)13.9k↓22%[1 issues](https://github.com/brzuchal/json-highlighter/issues)MITPHPPHP ^8.1

Since Oct 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/brzuchal/json-highlighter)[ Packagist](https://packagist.org/packages/brzuchal/json-highlighter)[ RSS](/packages/brzuchal-json-highlighter/feed)WikiDiscussions 1.0 Synced 1mo ago

READMEChangelogDependencies (2)Versions (1)Used By (0)

JSON Highlighter
================

[](#json-highlighter)

A simple PHP library for syntax highlighting JSON in the terminal.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require brzuchal/json-highlighter
```

Usage
-----

[](#usage)

You can use this library to highlight JSON strings in your terminal:

```
use Brzuchal\JsonHighlighter\JsonHighlighter;

$json = '{
"name": "John",
"age": 30,
"married": false,
"children": null
}';

echo JsonHighlighter::highlight($json);
```

This will output syntax-highlighted JSON in your terminal using ANSI escape codes.

Example Output
--------------

[](#example-output)

The output will look like:

```
{
    "name": "John",
    "age": 30,
    "married": false,
    "children": null
}
```

The keys will be in **light blue**, strings in **green**, numbers in **white**, booleans in **orange**, and `null` values in **light gray**.

License
-------

[](#license)

Copyright (c) 2024 Michał Marcin Brzuchalski

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

595d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce3143c657246081b652b3f2a6b370c8fcb58ca66c15d52f7557bfecbc38f9df?d=identicon)[brzuchal](/maintainers/brzuchal)

---

Top Contributors

[![brzuchal](https://avatars.githubusercontent.com/u/3149753?v=4)](https://github.com/brzuchal "brzuchal (2 commits)")

---

Tags

jsoncliconsoleterminalhighlightcolorizeprettify

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/brzuchal-json-highlighter/health.svg)

```
[![Health](https://phpackages.com/badges/brzuchal-json-highlighter/health.svg)](https://phpackages.com/packages/brzuchal-json-highlighter)
```

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B11.3k](/packages/symfony-console)[php-school/cli-menu

A command line menu helper in PHP

2.0k1.1M27](/packages/php-school-cli-menu)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)[aplus/cli

Aplus Framework CLI Library

2301.7M6](/packages/aplus-cli)[splitbrain/php-cli

Easy command line scripts for PHP with opt parsing and color output. No dependencies

177817.2k28](/packages/splitbrain-php-cli)[php-school/terminal

A command line terminal utility in PHP

21961.6k2](/packages/php-school-terminal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
