brzuchal/json-highlighter 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-01