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).
GetBoolfuncGetBool parses a bool environment variable.
GetDurationfuncGetDuration parses a duration environment variable.
GetIntfuncGetInt parses an int environment variable.
Loadrequire('dotenv').config()funcLoad parses a dotenv file and sets variables in the environment and override layer.
MustGetfuncMustGet returns the value or panics if missing.
SetfuncSet sets an override value (for tests).

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