Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yassineldeeb/env-typings-vsc
VS Code extension that auto generates types for process.env from your .env variables 💪
https://github.com/yassineldeeb/env-typings-vsc
generator types typescript typings vscode vscode-extension
Last synced: 14 days ago
JSON representation
VS Code extension that auto generates types for process.env from your .env variables 💪
- Host: GitHub
- URL: https://github.com/yassineldeeb/env-typings-vsc
- Owner: YassinEldeeb
- Created: 2021-12-03T21:48:34.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-06T10:25:23.000Z (about 3 years ago)
- Last Synced: 2024-10-19T10:04:37.639Z (3 months ago)
- Topics: generator, types, typescript, typings, vscode, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=YassinEldeeb.env-typings
- Size: 474 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
TS Env Typings
![Icon](https://raw.githubusercontent.com/YassinEldeeb/Env-Typings-VSC/main/images/vsIcon.png)
TS Env Typings is an extension to auto generate Typescript typings for your env variables from your development .env file everytime you save the specefied file.![Showoff](https://raw.githubusercontent.com/YassinEldeeb/Env-Typings-VSC/main/images/index.png)
## Setup
> ⚠️ Make sure you've @types/node installed before continuing
1- First of all, download the extension [TS Env Typings](https://marketplace.visualstudio.com/items?itemName=YassinEldeeb.env-typings)2- Specify "env-typings.json" file in the root of your project.
3- Add "path" field to your dev .env file.
![Config File](https://raw.githubusercontent.com/YassinEldeeb/Env-Typings-VSC/main/images/config.png)
That's it enjoy your auto generated typings from your .env file everytime you hit save.
## Features
1- Specify path for the generated output using the `output` field in the `env-typings.json` config file.
2- auto detect env variable type so that It can give you a nice example in the intellisense on how to use and parse it.
![Auto Detect Type](https://raw.githubusercontent.com/YassinEldeeb/Env-Typings-VSC/main/images/index.png)
3- Variants for an env variable
![Variants](https://raw.githubusercontent.com/YassinEldeeb/Env-Typings-VSC/main/images/enums.png)
- add a comment at the end of the env line that includes "# variants:"
- specify the different variants for your variable seperated by a "|" like you would in typscript
- quotes are optional around the variants values.```env
NODE_ENV='development' # variants: "development" | "production" | "testing"
```**Enjoy!**