
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
github.com/youla-dev/godenv
.env
filesThe Twelve-Factor App Manifest promotes using environment variables as the only configuration approach. We follow and love this principle.
The .env files are just a genuine extension of env vars. The .env files simplify local debug, exposing variables to a Docker containers, and so on.
Godenv is a tiny package that reads those .env files.
We took inspiration from the godotenv repository. The goal we pursued was to write a parser without using regular expressions but with a lexer/parser approach.
If you are curious about learning more about the approach, see the following links:
go get github.com/youla-dev/godenv
Add a configuration to your .env
file:
HTTP_ADDRESS=":8080"
LOG_LEVEL="info"
Then in the Go app read the file and parse its content:
package main
import (
"fmt"
"os"
"github.com/youla-dev/godenv"
)
func main() {
f, err := os.Open(".env")
if err != nil {
panic(err)
}
defer f.Close()
vars, err := godenv.Parse(f)
if err != nil {
panic(err)
}
fmt.Println(vars)
}
godenv
stands for go-dot-env. It is pronounced as goh denv
, not as gahd env
.
The complete specification can be found here: SPECIFICATION.md.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.