load method

void load([
  1. Iterable<String> filenames = const ['.env'],
  2. Parser psr = const Parser()
])

Parses environment variables from each path in filenames, and adds them to the underlying Map.

Logs to stderr if any file does not exist; see quiet.

Implementation

void load(
    [Iterable<String> filenames = const ['.env'],
    Parser psr = const Parser()]) {
  for (var filename in filenames) {
    var f = File.fromUri(Uri.file(filename));
    var lines = _verify(f);
    _map.addAll(psr.parse(lines));
  }
}