UNPKG

@hairy/lnv

Version:

Loading environment variables in Next.js and other frameworks can be quite cumbersome, and using dotenv or vault at runtime is also inconvenient. That's why my created this tool

23 lines (20 loc) 578 B
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url); import { resolveImportBin } from "./chunk-QIPGGXMB.js"; // src/internal/vault.ts import spawn from "nano-spawn"; async function vault(command, ...args) { const bin = await resolveImportBin("dotenv-vault"); let options = args[1]; let _args = []; if (typeof args[0] === "object") { options = args[0]; } else if (Array.isArray(args[0])) { _args = args[0]; } return spawn("node", [bin, command, ..._args.filter(Boolean)], options); } export { vault };