/View-JSON

JSON Viewer is a simple C++ program that reads and displays JSON data in a table format.

Primary LanguageC++MIT LicenseMIT

JSON Viewer

JSON Viewer is a simple C++ program that reads and displays JSON data in a table format. You can use it to view JSON files and navigate through nested JSON objects.

Prerequisites

  • C++ compiler (e.g., g++)
  • nlohmann/json library (already included in the project)

Installation

Clone the repository:

git clone https://github.com/yourusername/json-viewer.git
cd json-viewer

Build the program using g++:

g++ src/main.cpp -o build/view_json -Wall -Wextra

Usage

To view a JSON file:

./build/view_json 

To view a nested JSON object within a JSON file:

./build/view_json  [JSON_KEY1] [JSON_KEY2] ...
  • <JSON_PATH>: The path to the JSON file.
  • [JSON_KEY1] [JSON_KEY2] ...: Optional JSON keys to navigate nested objects.

Examples

View a JSON file:

./build/view_json data.json

View a nested JSON object:

./build/view_json data.json person address

License

This project is licensed under the MIT License. See the LICENSE file for details.