Skip to content

Latest commit

 

History

History
42 lines (25 loc) · 1.29 KB

README.md

File metadata and controls

42 lines (25 loc) · 1.29 KB

dotenv

Almost every language has dotenv. So why not Caché?

Add the capability of reading environment variables from a .env file or straight from your running OS.

Installing

The easiest way is to simply import the released XML from here

Usage

Quick and easy:

  • If you want to read from your OS use ##class(DotEnv.Parser).FromOS()
  • If you want to read from a file use ##class(DotEnv.Parser).FromPath("path/to/file", .status, ".env-prod")

Each method returns an %ArrayOfDataTypes instance populated with your env variables.

NOTE: When using FromPath, any of the existing ones won't be overwritten. Do NOT include the file name when passing the path to this method. Use the third parameter for that instead: (path, status code, file name). The default file name is .env.

Format

.env files should be composed using the following format:

YOUR_VARIABLE="your value"
YOUR_NUMBER=1337
WHATEVER="you want, it\'s also \nescaped"

CONTRIBUTING

Got some idea? Follow this guide.

LICENSE

MIT.