mockturtl c4f30559d3 wip subs
2015-05-09 20:24:29 -04:00
2015-04-07 19:32:22 -04:00
2015-05-09 20:24:29 -04:00
2015-05-09 20:24:29 -04:00
2015-05-08 01:16:17 -04:00
lib
2015-02-03 01:14:15 -05:00
2015-04-08 00:11:46 -04:00
2015-05-09 20:24:29 -04:00
pub
2015-04-07 19:41:48 -04:00
2015-05-08 01:16:17 -04:00
2015-05-09 20:24:29 -04:00

dotenv

Load environment variables at runtime from a .env file.

Pub Version Build Status

usage

Prefix the library import and call load(), exposing the env map with a top-level getter.

import 'package:dotenv/dotenv.dart' as dotenv;

Map<String, String> get _env => dotenv.env;

void main() {
  dotenv.load();
  var x = _env['foo'];
  // ...
}

Verify required variables are present:

const _requiredEnvVars = const ['host', 'port'];

bool get hasEnv => dotenv.isEveryDefined(_requiredEnvVars);

limitations

Does not yet support escaping. Pull requests gleefully considered.

prior art
Description
Loads environment variables from .env.
Readme MIT 631 KiB
Languages
C++ 33.4%
Dart 31.6%
CMake 27.3%
Swift 2.4%
C 2%
Other 3.3%