ccjsonparser

module
v0.0.0-...-b1ea630 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: MIT

README

ccjsonparser

ccjsonparser is a command-line tool for validating JSON data.

This is a Go study project based on the Coding Challenges exercises, particularly this one.

Features

  • Validate JSON: Validate JSON from file or standard input.

Installation

You can build and install ccjsonparser from source using Go. Make sure you have Go installed on your system.

  1. Clone the repository:

    git clone https://github.com/username/ccjsonparser.git
    cd ccjsonparser
    
  2. Build the executable:

    make build
    
  3. (Optional) Move the binary to a directory in your PATH for easy access:

    mv ccjsonparser /usr/local/bin/
    

Usage

ccjsonparser [filepath]
Examples
  1. Validate JSON from a file:

    ccjsonparser example.json
    
  2. Validate JSON from standard input:

    echo '{"name":"John","age":30}' | ccjsonparser
    

Exit Codes

Code Description
0 Valid JSON
1 Invalid JSON
2 Error reading from file/stdin

Test files

Test files (in testdata/ folder) came from Coding Challenges and JSON.org.

Future Ideas

  • Format JSON: Beautify and format JSON data for better readability.
  • Extract Data: Retrieve specific fields or values from JSON objects.
  • Filter Data: Apply filters to JSON data to extract relevant information.

License

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

Directories

Path Synopsis
cmd
internal
adt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL