package oenv

  1. Overview
  2. Docs

oenv: A composable environment variable reader 🧩

🏚️ Homepage: https://github.com/Nymphium/oenv

# let ( let* ) m k = Result.bind in
  let* host = Oenv.(string ~secret:false "HOST" |> read) in
  let* port = Oenv.(int "PORT" |> read) in
  Result.ok ()
;;
utop.bc: [INFO] Found HOST: localhost
utop.bc: [INFO] Found PORT: <secret>
- : (unit, Oenv.Errors.t) result = Ok ()

Features

  • Basic types: string, int, bool
  • 2nd types: list, option
  • Custom types
  • Record
  • Logging with Logs

Package

oenv providing Oenv module. See doc.

Development

Requires Nix and Direnv.

$ git clone https://github.com/Nymphium/oenv
$ direnv allow
$ dune build

LICENSE

This library is licensed under the MIT License.