{"id":20509547,"url":"https://github.com/aminnairi/environment","last_synced_at":"2026-05-27T20:31:23.916Z","repository":{"id":57097155,"uuid":"344227056","full_name":"aminnairi/environment","owner":"aminnairi","description":"Easily parse your environment","archived":false,"fork":false,"pushed_at":"2021-03-04T18:30:25.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"development","last_synced_at":"2025-08-01T13:50:58.413Z","etag":null,"topics":["dotenv","env","environment"],"latest_commit_sha":null,"homepage":"https://npmjs.com/@aminnairi/environment","language":"JavaScript","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/aminnairi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-03T18:34:01.000Z","updated_at":"2021-03-04T18:28:50.000Z","dependencies_parsed_at":"2022-08-20T16:50:39.613Z","dependency_job_id":null,"html_url":"https://github.com/aminnairi/environment","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aminnairi/environment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Fenvironment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Fenvironment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Fenvironment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Fenvironment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aminnairi","download_url":"https://codeload.github.com/aminnairi/environment/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Fenvironment/sbom","scorecard":{"id":189502,"data":{"date":"2025-08-11","repo":{"name":"github.com/aminnairi/environment","commit":"a18c0a05ba1f14def0993505cd550f9beec76e2f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/24 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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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: MIT License: 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":"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'development'"],"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":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc"],"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-16T20:22:00.467Z","repository_id":57097155,"created_at":"2025-08-16T20:22:00.467Z","updated_at":"2025-08-16T20:22:00.467Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33583394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"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":["dotenv","env","environment"],"created_at":"2024-11-15T20:25:21.710Z","updated_at":"2026-05-27T20:31:23.897Z","avatar_url":"https://github.com/aminnairi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @aminnairi/environment\n\nEasily parse your environment\n\n![minified size of the package](https://img.shields.io/bundlephobia/minzip/@aminnairi/environment) ![vulnerability count according to Snyk.io](https://img.shields.io/snyk/vulnerabilities/github/aminnairi/environment) ![NPM package's download count per month](https://img.shields.io/npm/dw/@aminnairi/environment) ![support of TypeScript](https://img.shields.io/npm/types/@aminnairi/environment)\n\n## Summary\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Simple](#simple)\n  - [Fancy](#fancy)\n  - [Interpollation](#interpollation)\n  - [Non-interpollation](#non-interpollation)\n  - [Multiline](#multiline)\n  - [Comments](#comments)\n  - [Undefined environment variables](#undefined-environment-variables)\n  - [Multiple environments](#multiple-environments)\n  - [Preview](#preview)\n  - [Error handling (async/await)](#error-handling-(async/await))\n  - [Error handling (Promise)](#error-handling-(promise))\n- [CHANGELOG](#changelog)\n- [CONTRIBUTING](#contributing)\n- [LICENSE](#license)\n\n## Requirements\n\n- [Node](https://nodejs.org/en/)\n- [NPM](https://www.npmjs.com/)\n- [NPX](https://www.npmjs.com/)\n\n## Installation\n\n```console\n$ npm install --save-exact @aminnairi/environment@0.2.2\n```\n\n## Usage\n\n### Simple\n\n```console\n$ touch .env\n```\n\n```\nUSER=johndoe\n```\n\n```console\n$ touch index.js\n```\n\n```javascript\nconst {Environment} = require(\"@aminnairi/environment\");\n\nconst main = async () =\u003e {\n    const environment = await Environment.from(\".env\");\n\n    console.log(environment.USER); // johndoe\n};\n\nmain().catch(error =\u003e console.error(error.message));\n```\n\n### Fancy\n\n```console\n$ touch .env\n```\n\n```\nUSER        =   johndoe\nPASSWORD    =   robustpassword\n```\n\n```console\n$ touch index.js\n```\n\n```javascript\nconst {Environment} = require(\"@aminnairi/environment\");\n\nconst main = async () =\u003e {\n    const environment = await Environment.from(\".env\");\n\n    console.log(environment.USER); // johndoe\n    console.log(environment.PASSWORD); // robustpassword\n};\n\nmain().catch(error =\u003e console.error(error.message));\n```\n\n### Interpollation\n\n```console\n$ touch .env\n```\n\n```\nUSER        =   johndoe\nPASSWORD    =   robustpassword\nHOST        =   domain\nDATBASE     =   database\nURL         =   \"$USER:$PASSWORD@$DOMAIN/$DATABASE\"\n```\n\n```console\n$ touch index.js\n```\n\n```javascript\nconst {Environment} = require(\"@aminnairi/environment\");\n\nconst main = async () =\u003e {\n    const environment = await Environment.from(\".env\");\n\n    console.log(environment.USER); // johndoe\n    console.log(environment.PASSWORD); // robustpassword\n    console.log(environment.DOMAIN); // domain\n    console.log(environment.DATABASE); // database\n    console.log(environment.URL); // johndoe:robustpassword@domain/database\n};\n\nmain().catch(error =\u003e console.error(error.message));\n```\n\n### Non-interpollation\n\n```console\n$ touch .env\n```\n\n```\nUSER        =   johndoe\nPASSWORD    =   robustpassword\nHOST        =   domain\nDATBASE     =   database\nURL         =   '$USER:$PASSWORD@$DOMAIN/$DATABASE'\n```\n\n```console\n$ touch index.js\n```\n\n```javascript\nconst {Environment} = require(\"@aminnairi/environment\");\n\nconst main = async () =\u003e {\n    const environment = await Environment.from(\".env\");\n\n    console.log(environment.USER); // johndoe\n    console.log(environment.PASSWORD); // robustpassword\n    console.log(environment.DOMAIN); // domain\n    console.log(environment.DATABASE); // database\n    console.log(environment.URL); // $USER:$PASSWORD@$DOMAIN/$DATABASE\n};\n\nmain().catch(error =\u003e console.error(error.message));\n```\n\n### Multiline\n\n```console\n$ touch .env\n```\n\n```\nMOTD = Hello everyone \\\n        I Hope that you are okay today because \\\n        I'm felling great!\n```\n\n```console\n$ touch index.js\n```\n\n```javascript\nconst {Environment} = require(\"@aminnairi/environment\");\n\nconst main = async () =\u003e {\n    const environment = await Environment.from(\".env\");\n\n    console.log(environment.MOTD); // Hello everyone I Hope that you are okay today because I'm felling great!\n};\n\nmain().catch(error =\u003e console.error(error.message));\n```\n\n### Comments\n\n```console\n$ touch .env\n```\n\n```\n# This is our guild's name\nGUILD_NAME = Outlawed\n\n# This is our guild's main goal\nGUILD_MAIN_OBJECTIVE = PVP\n\n# This is our guild's secondary goal\nGUILD_SECONDARY_OBJECTIVE = MM/HM\n```\n\n```console\n$ touch index.js\n```\n\n```javascript\nconst {Environment} = require(\"@aminnairi/environment\");\n\nconst main = async () =\u003e {\n    const environment = await Environment.from(\".env\");\n\n    console.log(environment.GUILD_NAME); // Outlawed\n    console.log(environment.GUILD_MAIN_OBJECTIVE); // PVP\n    console.log(environment.GUILD_SECONDARY_OBJECTIVE); // MM/HM\n};\n\nmain().catch(error =\u003e console.error(error.message));\n```\n\n### Undefined environment variables\n\n```console\n$ touch .env\n```\n\n```\nUSER = johndoe\nEMAIL = johndoe@noreply.users.github.com\n```\n\n```console\n$ touch index.js\n```\n\n```javascript\nconst {Environment} = require(\"@aminnairi/environment\");\n\nconst main = async () =\u003e {\n    const environment = await Environment.from(\".env\");\n\n    console.log(environment.USER_NAME); // undefined\n    console.log(environment.USER_EMAIL); // undefined\n};\n\nmain().catch(error =\u003e console.error(error.message));\n```\n\n### Multiple environments\n\n```console\n$ touch index.js\n```\n\n```javascript\nconst {Environment} = require(\"./environment.min.js\");\n\nconst main = async () =\u003e {\n    const [local, prod, test] = await Promise.all([\n        Environment.from(\".env.local\"),\n        Environment.from(\".env.prod\"),\n        Environment.from(\".env.test\")\n    ]);\n\n    console.log(local);\n    console.log(prod);\n    console.log(test);\n};\n\nmain().catch(error =\u003e console.error(error.message));\n```\n\n### Preview\n\n```console\n$ touch .env\n```\n\n```env\nUSER=johndoe\nPASSWORD=password\nHOST=host\nDATABASE=database\nURL=\"$USER:$PASSWORD@$HOST/$DATABASE\"\n```\n\n```console\n$ npx @aminnairi/environment .env\n\"USER\" \"johndoe\"\n\"PASSWORD\" \"password\"\n\"HOST\" \"host\"\n\"DATABASE\" \"database\"\n\"URL\" \"johndoe:password@host/database\"\n```\n\n### Error handling (async/await)\n\n```console\n$ touch index.js\n```\n\n```javascript\nconst {Environment} = require(\"@aminnairi/environment\");\n\nconst main = async () =\u003e {\n    try {\n        const environment = await Environment.from(\"not-a-file.env\");\n\n        console.log(environment);\n    } catch (error) {\n        console.log(\"Something went wrong\");\n        console.error(error.message);\n    }\n};\n\nmain();\n```\n\n### Error handling (Promise)\n\n```console\n$ touch index.js\n```\n\n```javascript\nconst {Environment} = require(\"@aminnairi/environment\");\n\nEnvironment.from(\"not-a-file.env\").then(environment =\u003e {\n    console.log(environment);\n}).catch(error =\u003e {\n    console.log(\"Something went wrong\");\n    console.error(error.message);\n});\n```\n\n## CHANGELOG\n\nSee [`CHANGELOG.md`](./CHANGELOG.md).\n\n## CONTRIBUTING\n\nSee [`CONTRIBUTING.md`](./CONTRIBUTING.md).\n\n## LICENSE\n\nSee [`LICENSE`](./LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminnairi%2Fenvironment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faminnairi%2Fenvironment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminnairi%2Fenvironment/lists"}