{"id":16991151,"url":"https://github.com/leon0399/dotenv-modern","last_synced_at":"2026-01-26T13:06:41.771Z","repository":{"id":96127528,"uuid":"540645758","full_name":"leon0399/dotenv-modern","owner":"leon0399","description":"Modern loader for multiple .env files","archived":false,"fork":false,"pushed_at":"2024-10-18T22:49:35.000Z","size":273,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-28T00:36:01.656Z","etag":null,"topics":["dotenv","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leon0399.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2022-09-23T23:12:08.000Z","updated_at":"2024-10-18T22:49:29.000Z","dependencies_parsed_at":"2024-11-26T23:45:21.702Z","dependency_job_id":"f2bafe51-447a-40e7-a295-8fca65e88d28","html_url":"https://github.com/leon0399/dotenv-modern","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/leon0399/dotenv-modern","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon0399%2Fdotenv-modern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon0399%2Fdotenv-modern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon0399%2Fdotenv-modern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon0399%2Fdotenv-modern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leon0399","download_url":"https://codeload.github.com/leon0399/dotenv-modern/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon0399%2Fdotenv-modern/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28778799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T11:46:04.308Z","status":"ssl_error","status_checked_at":"2026-01-26T11:46:02.664Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["dotenv","javascript"],"created_at":"2024-10-14T03:24:58.509Z","updated_at":"2026-01-26T13:06:41.766Z","avatar_url":"https://github.com/leon0399.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Deprecated**\n\u003e Use [`dotenvx`](https://github.com/dotenvx/dotenvx) or Node 20+ native [`--env-file`](https://nodejs.org/en/learn/command-line/how-to-read-environment-variables-from-nodejs#loading-env-files-programmatically-with-processloadenvfilepath) param\n\n# dotenv-modern\n\n`dotenv-modern` is more agile loader for multiple .env file for your projects, build on top of [dotenv](https://github.com/motdotla/dotenv) and [dotenv-expand](https://github.com/motdotla/dotenv-expand)\n\n## Install\n\nnpm:\n```bash\nnpm i dotenv-modern\n```\n\nYarn:\n```bash\nyarn add dotenv-modern\n```\n\npnpm:\n```bash\npnpm i dotenv-modern\n```\n\n## Usage\n\n`dotenv-modern` is a 100% substitute to [dotenv](https://github.com/motdotla/dotenv) and [dotenv-expand](https://github.com/motdotla/dotenv-expand) (cause it's build on top)\n\n```diff\n- require('dotenv').config()\n+ require('dotenv-modern').config()\nconsole.log(process.env) // remove this after you've confirmed it is working\n```\n\nor ES6\n\n```diff\n- import * as dotenv from 'dotenv'\n+ import * as dotenv from 'dotenv-modern'\ndotenv.config()\n// All dependant imports, that rely on environment variable have to be placed AFTER loading dotenv config\n\nimport express from 'express'\n```\n\n### Dotenv files hierarchy\n\n| Filename                 | Reccommended to .gitignore |\n| :----------------------- | :------------------------- |\n| `.env.${NODE_ENV}.local` | Yes                        |\n| `.env.local  `           | Yes                        |\n| `.env.${NODE_ENV}`       | No                         |\n| `.env`                   | No                         |\n\nProduction build order: `.env.production.local`, `.env.local`, `.env.production`, `.env`\n\nDevelopment run: `.env.development.local`, `.env.local`, `.env.development`, `.env`\n\nRunning tests: `.env.development.local`, `.env.development`, `.env`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleon0399%2Fdotenv-modern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleon0399%2Fdotenv-modern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleon0399%2Fdotenv-modern/lists"}