1 | import { config, parse } from "dotenv";
|
2 |
|
3 | const env = config();
|
4 | const dbUrl: string | null =
|
5 | env.error || !env.parsed ? null : env.parsed["BASIC"];
|
6 |
|
7 | config({
|
8 | path: ".env-example",
|
9 | encoding: "utf8",
|
10 | debug: true
|
11 | });
|
12 |
|
13 | const parsed = parse("NODE_ENV=production\nDB_HOST=a.b.c");
|
14 | const dbHost: string = parsed["DB_HOST"];
|
15 |
|
16 | const parsedFromBuffer = parse(new Buffer("JUSTICE=league\n"), {
|
17 | debug: true
|
18 | });
|
19 | const justice: string = parsedFromBuffer["JUSTICE"];
|