{"id":15992725,"url":"https://github.com/mpetuska/application.env","last_synced_at":"2026-02-25T06:15:30.847Z","repository":{"id":54912780,"uuid":"324734806","full_name":"mpetuska/application.env","owner":"mpetuska","description":".env file loader for node and browser","archived":false,"fork":false,"pushed_at":"2023-07-10T18:21:59.000Z","size":51395,"stargazers_count":1,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-28T00:25:29.498Z","etag":null,"topics":["browser","library","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpetuska.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},"funding":{"github":["mpetuska"]}},"created_at":"2020-12-27T10:15:14.000Z","updated_at":"2023-01-31T18:39:45.000Z","dependencies_parsed_at":"2024-10-08T06:40:50.021Z","dependency_job_id":"08d66d40-5953-4384-a1c9-a4046353ac30","html_url":"https://github.com/mpetuska/application.env","commit_stats":{"total_commits":42,"total_committers":3,"mean_commits":14.0,"dds":"0.38095238095238093","last_synced_commit":"a99d53fd52f3598aa185d0eca95b71664fa432f4"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/mpetuska/application.env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpetuska%2Fapplication.env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpetuska%2Fapplication.env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpetuska%2Fapplication.env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpetuska%2Fapplication.env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpetuska","download_url":"https://codeload.github.com/mpetuska/application.env/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpetuska%2Fapplication.env/sbom","scorecard":{"id":662823,"data":{"date":"2025-08-11","repo":{"name":"github.com/mpetuska/application.env","commit":"a99d53fd52f3598aa185d0eca95b71664fa432f4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/mpetuska/application.env/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/mpetuska/application.env/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/mpetuska/application.env/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/mpetuska/application.env/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/mpetuska/application.env/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/mpetuska/application.env/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/mpetuska/application.env/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/mpetuska/application.env/release.yml/master?enable=pin","Warn: containerImage not pinned by hash: .gitpod.Dockerfile:1: pin your Docker image by updating gitpod/workspace-full to gitpod/workspace-full@sha256:b1195dfae7ee9a12a89d195247c3e1357cc6a18360a41473dbec67525ef434e2","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T16:45:21.239Z","repository_id":54912780,"created_at":"2025-08-21T16:45:21.239Z","updated_at":"2025-08-21T16:45:21.239Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29812203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"last_error":"SSL_read: 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":["browser","library","nodejs"],"created_at":"2024-10-08T06:40:42.960Z","updated_at":"2026-02-25T06:15:30.806Z","avatar_url":"https://github.com/mpetuska.png","language":"TypeScript","funding_links":["https://github.com/sponsors/mpetuska"],"categories":[],"sub_categories":[],"readme":"[![gitpod ready-to-code](https://img.shields.io/badge/gitpod-ready--to--code-blue?logo=gitpod\u0026style=flat-square)](https://gitpod.io/#https://github.com/mpetuska/application.env)\n[![npm](https://img.shields.io/npm/v/application.env?logo=npm\u0026style=flat-square)](https://www.npmjs.com/package/application.env)\n# application.env\n\nSmall utility to load environment configurations that works for both, node and the browser, including a react context helper for react apps.\n\n## Usage\n\nIn most cases, all you need to do is invoke load function:\n\n```javascript\nimport { load } from 'application.env';\n\nload().then((env) =\u003e console.log('Env ready', env));\n```\n\nThe above will load `application.env` file and append it to global object (`proccess.env` for Node and `window.env`\nfor Browser).\n\n\u003e For Node you also get sync option:\n\u003e ```javascript\n\u003e import { loadSync } from 'application.env/node';\n\u003e\n\u003e const env = loadSync();\n\u003e console.log(env === proccess.env); // true\n\u003e ```\n\nAll load variants takes an optional options argument. Here's how its fields look with their default values:\n\n```typescript\nfunction load(\n  options: LoadOptions = {\n    path: 'application.env', // Path to a file\n    failSilently: false, // Returns/appends an empty object on error instead of throwing it.\n    validator: ObjectValidator\u003cEnv\u003e // Environment validator (read bellow)\n  }): Promise\u003cApplicationEnv.Env\u003e {}\n```\n\n## Validation\nAll `load` functions also provide a way to validate loaded env before appending it to the global objects via the second\n`validator` optional argument. It's basically an object describing the shape of your env object with exposed properties to handle missing values.\n```typescript\ninterface Env {\n  propOne: string;\n  nonStringProperty: number;\n  optionalProperty: string;\n  criticalProperty: string;\n}\n\nconst validator: ObjectValidator\u003cEnv\u003e = {\n  propOne: {\n    errorMessage: \"No default provided, throwing an error\",\n  },\n  nonStringProperty: {\n    default: 420,\n    converter: (value) =\u003e Number(value)\n  },\n  optionalProperty: {\n    default: \"DEFAULT VALUE\",\n  },\n  criticalProperty: {\n    critical: true,\n    errorMessage: \"The application cannot function without this property. Terminating...\",\n  },\n};\n\nload({validator})\n```\n\n## TypeScript\nThe module comes with it's own type declarations on both, public API and global scope extensions. It's also possible to declare your own named properties on loaded Env object via TS augmentation on `ApplicationEnv` namespace:\n```typescript\ndeclare global {\n  namespace ApplicationEnv {\n    interface Env {\n      MY_PROP_ONE?: string;\n      ANOTHER_REQUIRED_PROP: string;\n      ANOTHER_OPTIONAL_PROP: string;\n      NODE_ENV?: string;\n    }\n  }\n}\n```\n\n## React\nThis module exposes a React context provider and hook to consume the context in a child component\n\n```typescript \n\nimport ApplicationEnvProvider, { useApplicationEnv } from 'application.env/react';\n\nconst App: FC = (): JSX.Element =\u003e {\n  return (\n    \u003cApplicationEnvProvider path=\"/application.env\"\u003e\n      \u003cChild\u003e\n    \u003c/ApplicationEnvProvider\u003e\n  );\n};\n\nconst Child: FC = () : JSX.Element =\u003e {\n  const envVars = useApplicationEnv();\n\n  return (\u003ch1\u003e{envVars.MY_PROP_ONE}\u003c/h1\u003e)\n}\n\nexport default App;\n```\n\n## Behind the scenes\n\n* Node: the file is loaded from your file system.\n* Browser: the file is fetched from the same server that's serving HTML \u0026 JS files.\n* React: the file is fetched from the same server that's serving HTML \u0026 JS files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpetuska%2Fapplication.env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpetuska%2Fapplication.env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpetuska%2Fapplication.env/lists"}