Skip to content

Instantly share code, notes, and snippets.

@emidln
Last active December 27, 2015 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emidln/7241957 to your computer and use it in GitHub Desktop.
Save emidln/7241957 to your computer and use it in GitHub Desktop.
edn2json utility
(ns edn2json.core
(:require clojure.data.json clojure.edn clojure.string)
(:gen-class))
(defn all-lines [] (lazy-cat (when-let [line (read-line)] (cons line (all-lines)))))
(defn -main [] (clojure.data.json/write (clojure.edn/read-string (clojure.string/join " " (all-lines))) *out*))
(defproject edn2json "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"] [org.clojure/data.json "0.2.3"]]
:aot :all
:main edn2json.core)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment