brzuchal/json-highlighter
Composer 安装命令:
composer require brzuchal/json-highlighter
包简介
A PHP library for syntax highlighting JSON in the terminal.
README 文档
README
A simple PHP library for syntax highlighting JSON in the terminal.
Installation
Install the package via Composer:
composer require brzuchal/json-highlighter
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
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
Copyright (c) 2024 Michał Marcin Brzuchalski
This project is licensed under the MIT License. See the LICENSE file for details.
统计信息
- 总下载量: 2.3k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-01