1.1.0 • Published 7 months ago

auto-type-env v1.1.0

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

auto-type-env

npm version License

auto-type-env is a Node.js library that automatically generates TypeScript types for your environment variables.

Installation

You can install auto-type-env via npm:

npm install -g auto-type-env

# or

npx auto-type-env

Usage

Here's a quick example to get you started with auto-type-env:

auto-type-env -p .env -t ./src/environment.d.ts

# or

auto-type-env # will use default values

Example

Imagine you have a .env like this:

ULTRA_SECRET_VARIABLE=value
ANOTHER_SECRET=value2

This library will generate something like:

export {};

declare global {
	namespace NodeJS {
		interface ProcessEnv {
			ULTRA_SECRET_VARIABLE: string;
			ANOTHER_SECRET: string;
		}
	}
}

Then you will have all the items available for you when you type process.env

Contribution

Contributions are welcome! If you find a bug, have a feature request, or want to contribute in any other way, please open an issue or submit a pull request. We appreciate your feedback and involvement in making auto-type-env even better.

License

auto-type-env is MIT licensed, which means you can use it freely in your projects, both personal and commercial.

Contact

If you have any questions, suggestions, or feedback, you can reach me at contato@lucasgardini.com.


Disclaimer: auto-type-env is a third-party library and is not affiliated with or endorsed by Node.js or its contributors.

1.1.0

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago