https://github.com/yasu-s/dot-env-sample
https://github.com/yasu-s/dot-env-sample
dotenv
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/yasu-s/dot-env-sample
- Owner: yasu-s
- License: mit
- Created: 2019-10-09T11:55:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-11T12:40:42.000Z (over 6 years ago)
- Last Synced: 2025-04-04T05:41:55.981Z (about 1 year ago)
- Topics: dotenv
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 概要
dotenvを使用してNode.js実行前に設定を読み込むサンプルです。
# 実行環境
* Node.js - 10.x
* Yarn - 1.12.x
# 使用ライブラ
* dotenv - 8.1.x
# 動作確認
```
# dotenvによる読み込みなし
$ node index.js
# output: undefined
# dotenvによる.envファイル読み込み
$ node -r dotenv/config index.js
# output: hoge
# dotenvによる.env-localファイル読み込み
$ node -r dotenv/config index.js dotenv_config_path=./.env-local
# output: hogehoge
```
# 参考URL
* https://www.npmjs.com/package/dotenv