Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myxogastria0808/dotenv-caster-sample
https://github.com/myxogastria0808/dotenv-caster-sample
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/myxogastria0808/dotenv-caster-sample
- Owner: Myxogastria0808
- License: mit
- Created: 2024-06-05T07:20:56.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-10T03:23:56.000Z (7 months ago)
- Last Synced: 2024-06-10T04:30:58.125Z (7 months ago)
- Language: TypeScript
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.jsstringSample: 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```