{"id":16473091,"url":"https://github.com/binki/dotenv-byenv","last_synced_at":"2026-05-11T13:07:44.071Z","repository":{"id":57215396,"uuid":"135194695","full_name":"binki/dotenv-byenv","owner":"binki","description":"Load .env{,.ENVIRONMENT}{,.local} like react-scripts does for server-side","archived":false,"fork":false,"pushed_at":"2021-02-01T07:44:29.000Z","size":11,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T04:51:39.091Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/binki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-28T18:14:57.000Z","updated_at":"2021-02-01T07:44:29.000Z","dependencies_parsed_at":"2022-08-24T21:50:08.381Z","dependency_job_id":null,"html_url":"https://github.com/binki/dotenv-byenv","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/binki/dotenv-byenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fdotenv-byenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fdotenv-byenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fdotenv-byenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fdotenv-byenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binki","download_url":"https://codeload.github.com/binki/dotenv-byenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fdotenv-byenv/sbom","scorecard":{"id":238827,"data":{"date":"2025-08-11","repo":{"name":"github.com/binki/dotenv-byenv","commit":"b99582cf4ae1a96ee7ad3e1dffd668bffe8b2b1a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/11 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":-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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: npmCommand not pinned by hash: test.sh:13","Warn: npmCommand not pinned by hash: test.sh:15","Info:   0 out of   2 npmCommand 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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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"}}]},"last_synced_at":"2025-08-17T06:14:59.455Z","repository_id":57215396,"created_at":"2025-08-17T06:14:59.455Z","updated_at":"2025-08-17T06:14:59.455Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32896005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"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":"2024-10-11T12:25:18.279Z","updated_at":"2026-05-11T13:07:44.056Z","avatar_url":"https://github.com/binki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Purpose\n\nThe purpose of this package is to load `.env` files in a similar way to how [`react-scripts` does](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-development-environment-variables-in-env) for server-side apps.\nThis is quite different from how the popular [`dotenv`](https://www.npmjs.com/package/dotenv) package works.\n\n# Install\n\n```\nnpm install -S dotenv-byenv\n```\n\n# Usage\n\nBefore accessing `process.env`, you must call `config()`.\nFor example:\n\n```js\nrequire('dotenv-byenv').config();\n```\n\n`.env` files are found and loaded depending on your current environment as specified by the `NODE_ENV` environment variable.\nRecommended environments are `development`, `production`, and `test`.\nIf no environment is specified by the system, `NODE_ENV` will be set to `development`.\nDue to the nature of the load order, specifying `NODE_ENV` in `.env.local` does not make sense and the value will be ignored (because it is set prior to checking `.env` files).\nTo specify the environment, set `NODE_ENV` in the system environment (e.g., on POSIX: `NODE_ENV=production node index.js`).\n\nThe load order is as follows: `.env.${NODE_ENV}.local`, `.env.${NODE_ENV}`, `.env.local`, `.env`.\nCommon NODE_ENV values are below:\n\n1. `development`: `.env.development.local`, `.env.development`, `.env.local`, `.env`.\n2. `production`: `.env.production.local`, `.env.production`, `.env.local`, `.env`.\n3. `test`: `.env.test.local`, `.env.test`, `.env.local`, `.env`.\n\nIf a variable is already set on `process.env` and specified in a file, the value already in `process.env` takes precedence.\nSince the files are loaded in the above order, only the value in the most specific file will be used.\nFor example, if a variable is both in `.env.local` and `.env`, the value in `.env.local` will be used and the value in `.env` ignored.\nAdditionally, if a variable is passed via the system environment (e.g., on POSIX: `MY_VAR=x node index.js`) and specified in a file, the variable from the system environment is preferred.\n\nYou should commit all `.env` files except for those ending in `.local`.\nThis way, each developer can configure their specific values by editing `.env.local` or an environment-specific `.local` file without conflicting with other developers working on the same project.\n*Note: this recommendation goes against [the best practice recommended by the `dotenv` project](https://www.npmjs.com/package/dotenv#should-i-commit-my-env-file).\nThis difference is intentional.*\nTo achieve this, place the following in `.gitignore`:\n\n```\n*.local\n```\n\n## Preload\n\nYou may use the preload script to inject configuration into scripts without modifying them.\nSimply instruct the environment to load the `dotenv-byenv/config` module:\n\n```\n$ node -r dotenv-byenv/config index.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinki%2Fdotenv-byenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinki%2Fdotenv-byenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinki%2Fdotenv-byenv/lists"}