jsonsort

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

Maintenance Generic badge GPLv3 license Ask Me Anything !

jsonsort

The jsonsort is a command-line tool written in Go that allows you to sort JSON files based on keys. It provides a simple and efficient way to sort JSON data.

features

  • Support for sorting json files in ascending order.
  • Simple and intuitive command-line interface.

Installation

To install jsonsort, follow these steps:

  1. Make sure you have Go installed on your system. You can download and install it from the official website: https://golang.org/dl

  2. Run the following command to install the JSON Sorter CLI:

go install github.com/renanramonh/jsonsort
  1. The executable binary will be placed in your Go binary directory ($GOPATH/bin) after this command downloads the source code and compiles it..

  2. (Optional) To facilitate access, add the Go binary directory to your system's PATH environment variable. Edit your shell configuration file (~/.bashrc, ~/.bash_profile, or ~/.zshrc) and add the following command: export PATH=$PATH:$GOPATH/bin. Save the file and restart your terminal or run source ~/.bashrc (or the corresponding command for your shell) to apply the changes.

Usage

To sort a JSON file using jsonsort, use the following command:

jsonsort [file]

Replace [file] with the path to the JSON file you want to sort.

Here is an example command to sort a JSON file:

jsonsort ./input.json

the output file with the sorted json will be saved on ./input_sorted.json

Future Improvements

  • Sort JSON files based on specific keys or fields.
  • Support for sorting in ascending or descending order.
  • Format json output file with indentation

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

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