mvp-ai's picture
download
raw
423 Bytes
import { existsSync, readFileSync } from "node:fs";
export function loadEnvFile(path, env) {
if (!existsSync(path)) return env;
for (const line of readFileSync(path, "utf8").split("\n")) {
const m = line.match(/^\s*([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)\s*$/);
if (!m || line.trim().startsWith("#")) continue;
if (env[m[1]] === undefined) env[m[1]] = m[2].replace(/^["']|["']$/g, "");
}
return env;
}

Xet Storage Details

Size:
423 Bytes
·
Xet hash:
5174152221ea45f1232e321ad2040ea3d8ba6cf289dd80ca2f95583dbfa86802

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.