Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Command-line utility for manipulating JSON
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
config/jp
screenshots
scripts
src
tests
.gitignore
README.md
Setup.hs
jp.cabal

README.md

JSON command-line utility in Haskell

Jp is command-line utility to parse and transform JSON. JSON inputs can be filtered and transformed with Haskell Lens expressions.

Installation

  • Copy config/jp/modules into $HOME/.config/jp/modules
  • Execute this command in the shell to make cabal sandboxing happy:

    source ./scripts/sandbox.sh
    

Example of usages

cat ./tests/simple.json | sandbox exec ./dist/build/jp/jp -p 
sandbox exec ./dist/build/jp/jp ./tests/obj1.json -e '<&> members . _Number *~ 10'

Pretty printing

Resulting JSON expressions are pretty-printed with colors.

Lens expression

Lens expressions can be used to filter and modify the input.

Lens tutorials:

Screenshots

Applying a Lens expression

Lens expression

Simple Pretty Printing

Simple pretty printing

Something went wrong with that request. Please try again.