This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bb | |
;; convert.clj -- babashka edn/json/yaml to edn/json/yaml converter | |
;; Author: github.com/KGOH/ | |
;; Source: gist.github.com/KGOH/50c0f66022fea2ac173518a143238058 | |
;; Version: 2020.4 | |
; Usage example: | |
; In Emacs: i.imgur.com/TIEDmga.mp4 | |
; $ convert.clj edn <<< '{"foo": "bar"}' | |
; {:foo "bar"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(-> {:keyword-key "value0", | |
"test key with whitespaces" "value1", | |
"another key" "value2"} | |
clojure.data.json/write-str | |
(clojure.data.json/read-str :key-fn keyword) | |
prn-str | |
read-string) | |
;; => {:keyword-key "value0", | |
;; :test key, | |
;; with whitespaces, |