An experimental JSON formatter built using Parabix technology developed at Simon Fraser University.
json-fmt [options] [file]
The formatter can accept syntactically correct JSON input from either a file or from stdin. This is not a parser so trying to format invalid JSON won't produce any errors, just some weird output.
$ echo '{"a":"b"}' | json-fmt
{
"a":"b"
}
The Parabix framework is required to build this program, it can be found here. Along with this, a relatively recent version of LLVM (anything 4.0.0 or greater should do) and Boost are also required.
In order to ensure that the program works correctly, Parabix should be built with
ARTIFACT_MODE=Single
andARTIFACT_TYPE=Static
.Example Parabix CMake configuration:
cmake -DCMAKE_BUILD_TYPE=Release -DARTIFACT_MODE=Single -DARTIFACT_TYPE=Static ..
Once Parabix has been built and LLVM and Boost have been installed, the following commands can be used to build this project:
# In parabix-json-fmt repository directory
mkdir build
cd build
# Tell CMake where to find the Parabix include directory and libparabix.a library file
cmake -DPARABIX_INCLUDE=<path to parabix include dir> -DPARABIX_LIB=<path to location of libparabix.a> ..
# Build the project
make
PARABIX_INCLUDE
should be the path to wherever theparabix-devel/include
directory is on your machinePARABIX_LIB
should be the path to the directory that contains thelibparabix.a
library (this would be the directory that you built Parbix in)