update

Populate ENV from a hash of values

Ruby

Dotenvx.update(env = {}, overwrite: false)

Usage

Stringifies keys and values and returns the changed entries. overwrite defaults to false. true replaces existing values; :warn preserves them and reports a warning. This method does not read files.


require "dotenvx"
changed = Dotenvx.update({ "HELLO" => "World" }, overwrite: true)

markdown