Created
November 2, 2017 10:11
-
-
Save metametadata/b67a3e7f722589e04b021d60510be504 to your computer and use it in GitHub Desktop.
ClojureScript read env in NodeJS
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
(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