package oenv

  1. Overview
  2. Docs
A composable environment variable reader

Install

dune-project
 Dependency

Authors

Maintainers

Sources

oenv-0.1.0.tbz
sha256=0f9059e396f2ac8aeb8e9fde194a3708811d825c9f9df12d57aeb2d5b01cda1f
sha512=976de11d938b2726de50bcec3d83513decf6f59545d789f1d5065c7a612510f080729e3ade21910ea5547ff085b2f47e81aa41cfb507c9a9c4a02d103c0801f3

doc/index.html

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.