Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/myxogastria0808/dotenv-caster-sample


https://github.com/myxogastria0808/dotenv-caster-sample

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# dotenv-caster-sample

## How to Use

1. install packages

```sh
npm i
```

2. create `.env`

.env content

```.env
STRING_SAMPLE=Hello
NUMBER_SAMPLE=0
BIGINT_SAMPLE=123456789
SYMBOL_SAMPLE=SYMBOL
BOOLEAN_SAMPLE=true
NULL_SAMPLE=null

```

3. execute `src/index.ts`

```sh
npm run dev
```

3. execute `dist/index.js`

```sh
npm run compile
npm start
```

## Execution Result

```sh
$ npm run dev

> [email protected] dev
> ts-node-dev --respawn ./src/index.ts

[INFO] 17:42:26 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.2, typescript ver. 5.4.5)
stringSample: Hello
type: string
numberSample: 0
type: number
bigintSample: 123456789
type: bigint
symbolSample: Symbol(SYMBOL)
type: symbol
booleanSample: true
type: boolean
nullSample: null
type: object
nullSample is null

```

```sh
$ npm run compile

> [email protected] compile
> tsc -p .

$ npm start

> [email protected] start
> node dist/index.js

stringSample: Hello
type: string
numberSample: 0
type: number
bigintSample: 123456789
type: bigint
symbolSample: Symbol(SYMBOL)
type: symbol
booleanSample: true
type: boolean
nullSample: null
type: object
nullSample is null

```