Poncho - A .env parser/loader improved for performance.

poncho-logo

Poncho is a .env parser/loader improved for performance.

Mostly full support of parsing rules

Poncho parses the contents of your file containing environment variables is available to use. It accepts a String or IO and will return an Hash with the parsed keys and values. Currently supports the following rules:

  • Skipped the empty line and comment(#).
  • Ignore the comment which after (#).
  • NAME=foo becomes {"NAME" => "foo"}.
  • Empty values become empty strings.
  • Whirespace is removed from right ends of the value.
  • Single and Double quoted values are escaped.
  • New lines are expanded if in double quotes.
  • Inner quotes are maintained (such like json).
  • Overwrite optional (default is non-overwrite).
  • Only accpets string type value.

Following twelve-factor app of loading orders

Poncho loads the environment file is easy to use. It accepts both single file (or path) and multiple files. Loads single file supports the following order with environment name (default is development):

  • .env - The Original®
  • .env.development - Environment-specific settings.
  • .env.local - Local overrides. This file is loaded for all environments except test.
  • .env.development.local - Local overrides of environment-specific settings.

Read more: https://github.com/icyleaf/poncho