Like gofmt, but for JSON files.
Usage: jsonfmt or jsonfmt -w to autofix the issues.
homebrew:
brew install caarlos0/tap/jsonfmtdocker:
docker run -v $PWD:/data --workdir /data caarlos0/jsonfmt -hapt:
echo 'deb [trusted=yes] https://repo.caarlos0.dev/apt/ /' | sudo tee /etc/apt/sources.list.d/caarlos0.list
sudo apt update
sudo apt install jsonfmtyum:
echo '[caarlos0]
name=caarlos0
baseurl=https://repo.caarlos0.dev/yum/
enabled=1
gpgcheck=0' | sudo tee /etc/yum.repos.d/caarlos0.repo
sudo yum install jsonfmtdeb/rpm:
Download the .deb or .rpm from the releases page and
install with dpkg -i and rpm -i respectively.
manually:
Download the pre-compiled binaries from the releases page or clone the repo build from source.