auto-type-env
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i auto-type-env

Weekly Downloads

0

Version

1.1.0

License

none

Unpacked Size

7.29 kB

Total Files

9

Last publish

Collaborators

  • kowalskijr