Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ClojureScript read env in NodeJS
(defn -js->clj+
"For cases when built-in js->clj doesn't work. Source: https://stackoverflow.com/a/32583549/4839573"
[x]
(into {} (for [k (js-keys x)]
[k (aget x k)])))
(defn env
"Returns current env vars as a Clojure map."
[]
(-js->clj+ (.-env js/process)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment