Home

Awesome

mruby-yyjson

yyjson binding for mruby.

Installation

Add conf.gem line to build_config.rb:

MRuby::Build.new do |conf|
-- snip --

  conf.gem github: 'buty4649/mruby-yyjson'
end

Implemented Method

Methodmruby-yyjsonMemo
JSON.[]
JSON.create_id
JSON.create_id=
JSON.generator
JSON.parser
JSON.state
JSON.#dump
JSON.#fast_generatesame as JSON.generate(obj)
JSON.#fast_unparseobsolete
JSON.#generate
JSON.#unparseobsolete
JSON.#load
JSON.#load_filerequire mruby-io
JSON.#load_file!
JSON.#restore
JSON.#parse
JSON.#parse!
JSON.#pretty_generate
JSON.#pretty_unparseobsolete
JSON.#colorize_generatemruby-yyjson specific extension
Object#to_json

Colorize

The mruby-yyjson library now supports colorized JSON output, making it easier to read and debug complex JSON structures. By setting the colorize option to true in the JSON.color_generate or JSON.generate methods, you can achieve syntax-highlighted JSON output. This feature enhances the readability of nested JSON data by differentiating keys, strings, numbers, booleans, and other elements with distinct colors.

Default Colors

Customizing Colors

You can customize these colors using the following methods:

Refer to mruby-terminal-color for details on specifying colors.

License

mruby-yyjson is licensed under the MIT License.

This project includes code from the yyjson library, specifically yyjson.c and yyjson.h, which are licensed under the MIT License. A copy of the MIT License can be found in the LICENSE file in the root of this repository.