Skip to content
Node: dotenv / process.env7 APIs

env

Package env provides process.env and dotenv-style configuration loading.

import "github.com/sahilkhaire/gox/env"
## API reference

Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.

Functions ​

SymbolNode.jsKindSummary
Getprocess.env.KEYfuncGet returns the value for key (override, then os.Getenv).
GetBool—funcGetBool parses a bool environment variable.
GetDuration—funcGetDuration parses a duration environment variable.
GetInt—funcGetInt parses an int environment variable.
Loadrequire('dotenv').config()funcLoad parses a dotenv file and sets variables in the environment and override layer.
MustGet—funcMustGet returns the value or panics if missing.
Set—funcSet sets an override value (for tests).

MIT Licensed · Built for Node.js developers moving to Go