FLUTTER ECOSYSTEM

mockturtl/dotenv

從 `.env` 讀取環境變數。

dotenv 專案封面
Stars
116
Forks
75
最近推送(UTC)
2024年5月5日
專案狀態
未封存
mockturtl GitHub avatar
GITHUB User

mockturtl ↗

語言DartShell

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 5 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

dotenv

Load environment variables at runtime from a .env file.

Pub Version Build Status Documentation style: tidy

about

Deploying applications should be simple. This implies constraints:

The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env vars are easy to change between deploys without changing any code... they are a language- and OS-agnostic standard.

An environment is the set of variables known to a process (say, PATH, PORT, ...). It is desirable to mimic the production environment during development (testing, staging, ...) by reading these values from a file.

This library parses that file and optionally merges its values with the built-in Platform.environment map.

usage

See documentation and examples.

cli

Get the latest:

$ dart pub global activate dotenv

Run:

$ dart pub global run dotenv:new  # create a .env file and add it to .gitignore
$ dart pub global run dotenv      # load the file and print only the file environment variables to stdout
$ dart pub global run dotenv -p   # load the file and print all the environment variables to stdout
discussion

Use the issue tracker for bug reports and feature requests.

Pull requests gleefully considered.

prior art
license: MIT