Skip to content

NodeJS compatibility #69

@grav

Description

@grav

Would it make sense to make environ a wrapper around process.env? I have some code that does at least part of it, and I'll try my luck with a pull request if it's at all a sensible feature:

(ns environ.core
  (:require [clojure.string :as str]))

(defn- s->k [s]
  (-> s
      str/lower-case
      (str/replace "_" "-")
      keyword))

(def env
  (->> js/process.env
       js/Object.keys
       js->clj
       (map (fn [k] [(s->k k) (aget js/process.env k)]))
       (into {})))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions