{"id":30121944,"url":"https://github.com/galvinpython/managedenv","last_synced_at":"2026-01-20T16:52:42.513Z","repository":{"id":307638983,"uuid":"1028665385","full_name":"GalvinPython/managedenv","owner":"GalvinPython","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-01T11:06:29.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-01T11:18:41.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/GalvinPython.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-29T21:57:22.000Z","updated_at":"2025-08-01T11:05:34.000Z","dependencies_parsed_at":"2025-08-01T11:18:46.765Z","dependency_job_id":"b831a97a-1b65-4882-a911-18ae33f0601c","html_url":"https://github.com/GalvinPython/managedenv","commit_stats":null,"previous_names":["galvinpython/managedenv"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/GalvinPython/managedenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GalvinPython%2Fmanagedenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GalvinPython%2Fmanagedenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GalvinPython%2Fmanagedenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GalvinPython%2Fmanagedenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GalvinPython","download_url":"https://codeload.github.com/GalvinPython/managedenv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GalvinPython%2Fmanagedenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269733455,"owners_count":24466536,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-10T13:35:45.724Z","updated_at":"2026-01-20T16:52:42.508Z","avatar_url":"https://github.com/GalvinPython.png","language":"TypeScript","readme":"# ManagedEnv\n\n[![CI: Test (Node.js)](https://github.com/GalvinPython/managedenv/actions/workflows/test-node.yml/badge.svg)](https://github.com/GalvinPython/managedenv/actions/workflows/test-node.yml)\n[![Publish Package to npmjs](https://github.com/GalvinPython/managedenv/actions/workflows/main.yml/badge.svg)](https://github.com/GalvinPython/managedenv/actions/workflows/main.yml)\n[![NPM Version](https://img.shields.io/npm/v/managedenv)](https://www.npmjs.com/package/managedenv)\n[![Supported NodeJS Versions](https://img.shields.io/badge/NodeJS%20Versions-20,22,24,25-blue)](https://www.npmjs.com/package/managedenv)\n\nNotice: ManagedEnv is currently in beta\n\nManagedEnv is a lightweight, zero-dependency environment variable management package. It allows you to define, load, and validate environment variables with ease, making it a powerful tool for managing your application's configuration and environment variables.\n\n# Features\n\nFeatures of ManagedEnv are that:\n\n- It's type-safe\n- Auto-casted typings means that you can easily see variables that exist or don't exist\n- Declare required and optional variables\n- Scope your variables to different projects (useful in monorepo settings)\n- Set fallback environment variables (such as ports)\n\n# Example Usage\n\nAs ManagedEnv is in beta, there's likely to be future API changes, however this how you use the current API:\n\nLets assume in your project, you have a `.env` file that looks like\n\n```bash\nAPI_KEY=test\n```\n\nIn your file (for example `index.ts`):\n\n```ts\n// Import the EnvManager class from managedenv\nimport { EnvManager } from \"managedenv\";\n\n// Create a new instance, but remember to call `.add()` to the end of it\nconst envManager = new EnvManager().add({\n  name: \"API_KEY\",\n  required: false,\n});\n\n// Load the variables using the `.load()` function\nconst envs = envManager.load();\n\n// To verify it works\nconsole.log(\"API_KEY:\", envs.env.API_KEY);\n```\n\nNow this has native support for Bun at the moment, so in your terminal run your file and verify the output:\n\n```bash\n$ bun index.ts\n```\n\n```bash\nAPI_KEY: test\n```\n\n# Changelog\n\n## Preview\n\n### 0.2.0\n\n- Removed `flag` property in favour of `useFlagInstead`\n- Added new `useWithFlag` property to load an environment variable when an associated flag is passed into the arguments\n\n### 0.1.0\n\n- Added documentation\n- First release\n\n### 0.0.1\n\n_Note: This version was never published_\n\n- Initial commit\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalvinpython%2Fmanagedenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalvinpython%2Fmanagedenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalvinpython%2Fmanagedenv/lists"}