stringify

import { stringify } from "jsr:@ende/dotenv";

function

function stringify(object: Record<string, string>): string

Stringify an object into a valid .env file format.

object: Record<string, string>

object to be stringified

Returns

string of object

Example: Usage

import { stringify } from "@ende/dotenv/stringify";
import { assertEquals } from "@ende/assert";

const object = { GREETING: "hello world" };
assertEquals(stringify(object), "GREETING='hello world'");

Source