{"id":31843443,"url":"https://github.com/farkmarnum/dotenv-hot","last_synced_at":"2026-05-14T21:33:29.383Z","repository":{"id":57677996,"uuid":"490123681","full_name":"farkmarnum/dotenv-hot","owner":"farkmarnum","description":"Dotenv that works with hot reloading","archived":false,"fork":false,"pushed_at":"2022-05-11T15:09:10.000Z","size":589,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T23:25:29.116Z","etag":null,"topics":["dotenv","env","environment-variables","hmr","hot-reload","nodejs"],"latest_commit_sha":null,"homepage":"","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/farkmarnum.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}},"created_at":"2022-05-09T03:36:59.000Z","updated_at":"2022-05-10T00:29:21.000Z","dependencies_parsed_at":"2022-08-31T05:40:22.814Z","dependency_job_id":null,"html_url":"https://github.com/farkmarnum/dotenv-hot","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/farkmarnum/dotenv-hot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farkmarnum%2Fdotenv-hot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farkmarnum%2Fdotenv-hot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farkmarnum%2Fdotenv-hot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farkmarnum%2Fdotenv-hot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farkmarnum","download_url":"https://codeload.github.com/farkmarnum/dotenv-hot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farkmarnum%2Fdotenv-hot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33044147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"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-variables","hmr","hot-reload","nodejs"],"created_at":"2025-10-12T07:00:47.782Z","updated_at":"2026-05-14T21:33:29.377Z","avatar_url":"https://github.com/farkmarnum.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotenv-hot 🔥\n\nDotenv that works with hot reloading.\n\n## Installation\n\n```bash\n# Using defaults:\nnpx dotenv-hot install\n\n# Or, specifying directories:\nnpx dotenv-hot install --env-module-dir client/src --scripts-dir lib\n\n# See `npx dotenv-hot --help` for full usage instructions.\n```\n\n*After running this, commit the staged changes.*\n\n## Usage\n\n```bash\nnpx dotenv-hot watch\n```\n\nOr, install with `yarn add -D dotenv-hot` and add to your `package.json`:\n```json\n{\n  \"scripts\": {\n    \"watch-env\": \"dotenv-hot watch\"\n  }\n}\n```\n\n## To remove\n\nTo remove the added files and the git fiter, run:\n```bash\nnpx dotenv-hot uninstall\n```\n\n## How it works\n\n### When installed\n- It creates several files:\n   - `.envFromFile.[ts|js]` — when `watch` is run, the values from `.env` are loaded into this file as JS variable declarations. This file is fully maintained by `dotenv-hot` and should not be modified. By default this is added in `\u003cgitRepoRoot\u003e/src`, but can be customized with the `--env-module-dir` flag.\n\n   - `env.[ts|js]` — this file handles importing the vars from `.envFromFile.[ts|js]`, falling back on the values in `process.env`, and exporting. This is where you'll import env vars from, and you'll need to add new lines in this file when you have new env vars that you want to use in this way. By default this is also added in `\u003cgitRepoRoot\u003e/src`, but is also customizable with the `--env-module-dir` flag.\n\n   - `git-filter-dotenv-hot-env-module.sh` — this is a script for use by `git` as a `filter`. This file also does not need to be modified. By default this is added in `\u003cgitRepoRoot\u003e/scripts`, but can be customized with the `--scripts-dir` flag.\n\n- It tells `git` to use the filter in `scripts` for the `.envFromFile.[ts|js]` file. This prevents the local changes that are made to this file from being seen by git.\n\n### When run with `watch`\n\n- It monitors the contents of `.env`, and if they change it updates `.envFromFile.[ts|js]`\n\n### When in prod\n\nBy default, any `.env` files will be ignored by this package in `prod`, since the `dotenv-hot watch` process will not be running. However, if you need to load values from a `.env` file in prod (no hot reloading here though), you can add `dotenv` and uncomment the relevant lines in `env.[ts|js]`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarkmarnum%2Fdotenv-hot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarkmarnum%2Fdotenv-hot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarkmarnum%2Fdotenv-hot/lists"}