{"id":17929160,"url":"https://github.com/emiyaaaaa/gen-env-dts","last_synced_at":"2026-05-15T12:34:09.426Z","repository":{"id":216165519,"uuid":"740624103","full_name":"Emiyaaaaa/gen-env-dts","owner":"Emiyaaaaa","description":"Easily generate 'env.d.ts' files for '.env' files","archived":false,"fork":false,"pushed_at":"2024-04-11T03:31:17.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T19:43:44.986Z","etag":null,"topics":["declaration","env","env-d-ts","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/gen-env-dts","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/Emiyaaaaa.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}},"created_at":"2024-01-08T18:15:22.000Z","updated_at":"2024-03-19T07:03:13.000Z","dependencies_parsed_at":"2024-08-21T02:47:22.558Z","dependency_job_id":null,"html_url":"https://github.com/Emiyaaaaa/gen-env-dts","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.07692307692307687,"last_synced_commit":"014552d2a09a75fb7e0b14a75f53052cfb774741"},"previous_names":["emiyaaaaa/gen-env-dts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emiyaaaaa%2Fgen-env-dts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emiyaaaaa%2Fgen-env-dts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emiyaaaaa%2Fgen-env-dts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emiyaaaaa%2Fgen-env-dts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Emiyaaaaa","download_url":"https://codeload.github.com/Emiyaaaaa/gen-env-dts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246981166,"owners_count":20863828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["declaration","env","env-d-ts","typescript"],"created_at":"2024-10-28T21:07:51.834Z","updated_at":"2026-05-15T12:34:09.420Z","avatar_url":"https://github.com/Emiyaaaaa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gen-env-dts\nEasily generate `env.d.ts` files for `.env` files\n\n### Output (Support custom template)\n```ts\n// ./env.d.ts\ndeclare global {\n\tnamespace NodeJS {\n\t\tinterface ProcessEnv {\n\t\t\tAK: string\n\t\t\tSK: string\n\t\t}\n\t}\n}\n\nexport {}\n```\n\n![image](https://github.com/Emiyaaaaa/gen-env-dts/assets/37606228/1b26c33c-621a-46c2-a648-a5305f6a4b41)\n\n## Usage 1\n```bash\nnpx gen-env-dts\n```\n\n## Usage 2\n\n```bash\n# npm\nnpm install --save-dev gen-env-dts\n```\n\n./package.json\n```json\n{\n  \"scripts\": {\n    \"env-dts\": \"gen-env-dts\"\n  }\n}\n```\n```bash\nnpm run env-dts\n```\n\n## Options\n- `--input` (or `-i`)\n- `--output` (or `-o`)\n- `--template` (or `-t`)\n\n\n\n### `--input` (or `-i`)\nInput file path, default: `.env`\n```bash\nnpx gen-env-dts -i ./path/to/env/file\n```\nMultiple input files\n```bash\nnpx gen-env-dts -i ./path/to/env/file1 -i ./path/to/env/file2 -o ./path/to/output/file1 -o ./path/to/output/file2\n```\n\u003eNOTE: If multiple input files are set, you need to use `--output` option to specify all of output files path.\n\n### `--output` (or `-o`)\nOutput file path, default: `./env.d.ts`\n```bash\nnpx gen-env-dts -o ./path/to/output/file\n```\n\n### `--template` (or `-t`)\nCustom template file path\n```bash\nnpx gen-env-dts -t ./path/to/template/file\n```\n\nDefault template:\n```ts\n// ./template.d.ts\ndeclare global {\n\tnamespace NodeJS {\n\t\tinterface ProcessEnv {\n\t\t\t// DON'T CHANGE NEXT LINE, this will be replaced by the env variables\n\t\t\tTEMPLATE_REPLACE \n\t\t}\n\t}\n}\n\nexport {}\n```\n\nYour custom template:\n```ts\n// ./my-template.d.ts\nexport interface MyEnv {\n\t// DON'T CHANGE NEXT LINE, this will be replaced by the env variables\n\tTEMPLATE_REPLACE \n}\n```\n```bash\nnpx gen-env-dts -t ./my-template.d.ts\n```\nYou will get:\n```ts\n// ./env.d.ts\nexport interface MyEnv {\n\tAK: string\n\tSK: string\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femiyaaaaa%2Fgen-env-dts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femiyaaaaa%2Fgen-env-dts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femiyaaaaa%2Fgen-env-dts/lists"}