Home

Awesome

malapropism

test lint check editorconfig downloads

An omniconf inspired config library using malli

Latest version

malapropism is deployed to Clojars

Clojars Project

Rationale

Configuration is one of the peripheries of our systems. It's a good place to ensure correctness. Enter malli, a library that I've really grown to appreciate.

Configuration should be flexible. Most solutions in this space assume too much.

With malapropism,

Usage

(require '[org.passen.malapropism.core :as malapropism])

(def config-schema
  [:map
   [:env-key :keyword]
   [:scm-rev :string]
   [:port :int]
   [:prefix
    {:default "/api"}
    :string]])

(-> (malapropism/with-schema config-schema)
    (malapropism/with-values-from-env)
    (malapropism/with-values-from-system)
    (malapropism/with-values-from-map
      {:env-key :dev
       :scm-rev "923345"
       :port    8080
       :prefix  "/web"})
    (malapropism/verify! :verbose? true))

Consumers

These companies use malapropism. Feel free to add your company to the list.

License

Copyright © 2022-2023 Derek Passen

Released under an MIT license.