Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bang88/dotenv-to-ts
Convert dotenv file to TypeScript type definitions
https://github.com/bang88/dotenv-to-ts
Last synced: 8 days ago
JSON representation
Convert dotenv file to TypeScript type definitions
- Host: GitHub
- URL: https://github.com/bang88/dotenv-to-ts
- Owner: BANG88
- License: mit
- Created: 2017-10-25T04:25:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-25T05:49:24.000Z (over 7 years ago)
- Last Synced: 2025-01-04T15:16:34.494Z (22 days ago)
- Language: TypeScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# dotenv-to-ts [![Build Status](https://travis-ci.org/bang88/dotenv-to-ts.svg?branch=master)](https://travis-ci.org/bang88/dotenv-to-ts)
> Convert dotenv file to TypeScript type definitions
## Install
```
$ npm install --save dotenv-to-ts# or
$ yarn add dotenv-to-ts
```## Usage
```js
import dotenvToTs from 'dotenv-to-ts'dotenvToTs();
// export interface Environments {
// HOST: string;
// }
```## API
### dotenvToTs(input, output, name)
#### input
Type: `string`
Input env file path defaults to [.env]
#### output
Type: `string`
Output type definition file path defaults to [env.d.ts]
#### name
Type: `string`
Interface's name defaults to [Environments]
## CLI
```
$ npm install --global dotenv-to-ts
``````
$ dotenv-to-ts --helpUsage
$ dotenv-to-tsOptions
--input Input env file path defaults to [.env]
--output Output type definition file path defaults to [env.d.ts]
--name Interface's name defaults to [Environments]Examples
$ dotenv-to-ts --input .env.example --output example.env.d.ts
$ dotenv-to-ts --name MyEnv```
## License
MIT © [bang](https://github.com/bang88)