Liking cljdoc? Tell your friends :D

jet

CircleCI Clojars Project cljdoc badge

Transform JSON into EDN into Transit and vice versa.

Usage

jet supports the following options:

  • --from: allowed values: edn, transit or json
  • --to: allowed values: edn, transit or json
  • --keywordize: if present, keywordizes JSON keys.
  • --version: if present, prints current version of jet and exits.

Examples:

$ echo '{"a": 1}' | jet --from json --to edn
{"a" 1}
$ echo '{"a": 1}' | jet --from json --keywordize --to edn
{:a 1}
$ echo '{"a": 1}' | jet --from json --to transit
["^ ","a",1]

Installation

Linux and macOS binaries are provided via brew.

Install:

brew install borkdude/brew/jet

Upgrade:

brew upgrade jet

This tool can also be used via the JVM. If you use leiningen, you can put the following in your .lein/profiles:

{:user
 {:dependencies [[borkdude/jet "0.0.2-SNAPSHOT"]]
  :aliases {"jet" ["run" "-m" "jet.main"]}}}

And then call jet like:

$ echo '["^ ","~:a",1]' | lein jet --from transit --to edn
{:a 1}

Test

Test the JVM version:

script/test

Test the native version:

JET_TEST_ENV=native script/test

Build

You will need leiningen and GraalVM.

script/compile

License

Copyright © 2019 Michiel Borkent

Distributed under the EPL License, same as Clojure. See LICENSE.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close