{"id":37095434,"url":"https://github.com/sameerjadav/envparse","last_synced_at":"2026-01-14T11:45:45.972Z","repository":{"id":251195563,"uuid":"836683389","full_name":"SameerJadav/envparse","owner":"SameerJadav","description":"Go package designed for efficiently parsing environment variables from .env files. It provides a straightforward and performant way to load environment variables into your Go applications.","archived":false,"fork":false,"pushed_at":"2024-08-09T08:41:38.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-09T10:03:02.319Z","etag":null,"topics":["env-parser","environment-variables","go","golang","golang-package"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SameerJadav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-01T10:44:53.000Z","updated_at":"2024-08-09T08:41:41.000Z","dependencies_parsed_at":"2024-08-01T12:38:04.543Z","dependency_job_id":"8bd64e6b-70b7-48c2-bcb0-8bb9489f9b97","html_url":"https://github.com/SameerJadav/envparse","commit_stats":null,"previous_names":["sameerjadav/envparse"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/SameerJadav/envparse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SameerJadav%2Fenvparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SameerJadav%2Fenvparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SameerJadav%2Fenvparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SameerJadav%2Fenvparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SameerJadav","download_url":"https://codeload.github.com/SameerJadav/envparse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SameerJadav%2Fenvparse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["env-parser","environment-variables","go","golang","golang-package"],"created_at":"2026-01-14T11:45:45.336Z","updated_at":"2026-01-14T11:45:45.966Z","avatar_url":"https://github.com/SameerJadav.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EnvParse\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/SameerJadav/envparse.svg)](https://pkg.go.dev/github.com/SameerJadav/envparse) [![Tests](https://github.com/SameerJadav/envparse/actions/workflows/tests.yml/badge.svg)](https://github.com/SameerJadav/envparse/actions/workflows/tests.yml)\n\nEnvParse is a Go package designed for efficiently parsing environment variables from `.env` files. It provides a straightforward and performant way to load environment variables into your Go applications.\n\n## Features\n\n- Parse environment files from any `io.Reader` source\n- Parse environment files directly from a file\n- Handling of quoted values (double quotes, single quotes, and backticks)\n- Variable expansion in non-quoted and double-quoted values\n- Error reporting with line numbers for invalid syntax\n\n## Parsing Details\n\n- Double-quoted values are unescaped, including unicode characters\n- Single-quoted and backtick-quoted values are treated as literal strings\n- Variable expansion is performed in non-quoted and double-quoted values\n- Commented lines (lines prefixed with `#`), invalid lines (lines that are not comments and do not have an `=` sign), and lines with empty key will not be parsed\n- Inline comments are removed from the value. If you want `#` in your value, you should quote it (e.g., `KEY=\"VALUE#with hash\"`)\n- Does not support multiline values\n\n## Installation\n\n```shell\ngo get github.com/SameerJadav/envparse\n```\n\n## Usage\n\nParse from `io.Reader`\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/SameerJadav/envparse\"\n)\n\nfunc main() {\n\tfile, err := os.Open(\".env\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\n\tenv, err := envparse.Parse(file)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfor key, value := range env {\n\t\tos.Setenv(key, value)\n\t}\n}\n```\n\nParse from File\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/SameerJadav/envparse\"\n)\n\nfunc main() {\n\tenv, err := envparse.ParseFile(\".env\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfor key, value := range env {\n\t\tos.Setenv(key, value)\n\t}\n}\n```\n\n## Contributing\n\nContributions are welcome. Please open an issue or submit a pull request.\n\n## License\n\nEnvParse is open-source and available under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameerjadav%2Fenvparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsameerjadav%2Fenvparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameerjadav%2Fenvparse/lists"}