{"id":23318553,"url":"https://github.com/ericc-ch/env","last_synced_at":"2025-06-13T13:37:37.100Z","repository":{"id":264652966,"uuid":"850143443","full_name":"ericc-ch/env","owner":"ericc-ch","description":"(very) simple wrapper around std-env","archived":false,"fork":false,"pushed_at":"2025-01-10T13:53:13.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T05:18:35.289Z","etag":null,"topics":["utilities"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@echristian/env","language":"TypeScript","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/ericc-ch.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-31T01:28:17.000Z","updated_at":"2025-01-10T13:53:16.000Z","dependencies_parsed_at":"2025-02-13T09:42:41.643Z","dependency_job_id":null,"html_url":"https://github.com/ericc-ch/env","commit_stats":null,"previous_names":["ericc-ch/env"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ericc-ch/env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericc-ch%2Fenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericc-ch%2Fenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericc-ch%2Fenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericc-ch%2Fenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericc-ch","download_url":"https://codeload.github.com/ericc-ch/env/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericc-ch%2Fenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259654175,"owners_count":22890971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["utilities"],"created_at":"2024-12-20T17:17:24.399Z","updated_at":"2025-06-13T13:37:37.077Z","avatar_url":"https://github.com/ericc-ch.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @ericc/env\n\n\u003e A simple wrapper around std-env, providing a convenient interface for environment variable handling.\n\n## Installation\n\n```bash\nnpm i @echristian/env std-env\n```\n\n## Dependencies\n\nThis package requires `std-env` as a peer dependency. Make sure to install it alongside this package:\n\n- `std-env` \u003e= 3.0.0\n\n## Why?\n\nThis package provides a simplified interface for common environment variable operations:\n\n1. Throw when required environment variable does not exist\n2. Fallback to default value for optional variable\n3. Avoid repeatedly writing optional chaining and error throwing (with this the value won't be `Value | undefined`)\n\n## Usage\n\n```typescript\nimport { getEnv } from \"@ericc/env\";\nimport { env } from \"std-env\";\n\n// Using getEnv helper\nconst API_KEY = getEnv(\"API_KEY\"); // throws if not found\nconst IMAGE_DIR = getEnv(\"IMAGE_DIR\", \"/tmp\"); // with fallback\n\n// Use std-env directly for its exports\nconsole.log(env.NODE_ENV);\nconsole.log(env.platform);\n```\n\n## Related\n\nCheck out [std-env](https://github.com/unjs/std-env) because [unjs](https://github.com/unjs) is awesome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericc-ch%2Fenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericc-ch%2Fenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericc-ch%2Fenv/lists"}