Skip to main content

@std/dotenv@0.225.3
Built and signed on GitHub Actions

UNSTABLE: Parsing and loading environment variables from a `.env` file

This package works with DenoIt is unknown whether this package works with Bun
This package works with Deno
It is unknown whether this package works with Bun
JSR Score
94%
Published
5 months ago (0.225.3)

Parses and loads environment variables from a .env file into the current process, or stringify data into a .env file format.

Note: The key needs to match the pattern /^[a-zA-Z_][a-zA-Z0-9_]*$/.

// Automatically load environment variables from a `.env` file
import "@std/dotenv/load";
import { parse, stringify } from "@std/dotenv";
import { assertEquals } from "@std/assert";

assertEquals(parse("GREETING=hello world"), { GREETING: "hello world" });
assertEquals(stringify({ GREETING: "hello world" }), "GREETING='hello world'");
Built and signed on
GitHub Actions
View transparency log

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/dotenv

Import symbol

import * as dotenv from "@std/dotenv";
or

Import directly with a jsr specifier

import * as dotenv from "jsr:@std/dotenv";

Add Package

bunx jsr add @std/dotenv

Import symbol

import * as dotenv from "@std/dotenv";