|
9 miesięcy temu | |
---|---|---|
.env | 9 miesięcy temu | |
.env.wrong | 9 miesięcy temu | |
.gitignore | 9 miesięcy temu | |
LICENSE | 9 miesięcy temu | |
README.md | 9 miesięcy temu | |
minimal_dotenv.test.ts | 9 miesięcy temu | |
minimal_dotenv.ts | 9 miesięcy temu |
A very minimal .env
parser for Deno.
Requires --allow-read
and --allow-env
permissions (for obvious reasons).
import dotenv from "https://deno.land/x/minimal_dotenv/minimal_dotenv.ts";
await dotenv();
// Optionally, you can specify the filename/full path:
// await dotenv(".env.different");
// With .env file containing MINIMAL_DOTENV="working" outputs:
// minimal_dotenv is working
console.log(`minimal_dotenv is ${Deno.env.get("MINIMAL_DOTENV")}`);
To test and generate code coverage (requires
LCOV‘s genhtml
to output HTML).
# Run the tests and emit coverage data.
deno test --allow-read --allow-env --coverage=.coverage
# Convert Deno's output coverage to LCOV.
deno coverage --lcov .coverage > .coverage/report.lcov
# Convert LCOV to HTML.
genhtml -o .coverage/html .coverage/report.lcov
# Open the coverage in your browser.
firefox .coverage/html/index.html
Licensed with the AGPL-3.0-or-later license.