MCPcopy Create free account
hub / github.com/TanStack/ai / loadEnvFileIntoEnv

Function loadEnvFileIntoEnv

examples/ts-react-native-chat/scripts/dev.mjs:12–25  ·  view source on GitHub ↗
(
  envFile = DEFAULT_ENV_FILE,
  env = process.env,
)

Source from the content-addressed store, hash-verified

10const loadedEnvKeysByEnv = new WeakMap()
11
12export function loadEnvFileIntoEnv(
13 envFile = DEFAULT_ENV_FILE,
14 env = process.env,
15) {
16 const result = loadDotenv({
17 path: envFile,
18 processEnv: env,
19 quiet: true,
20 })
21
22 loadedEnvKeysByEnv.set(env, Object.keys(result.parsed ?? {}))
23
24 return Boolean(result.parsed)
25}
26
27export function getPnpmCommand(platform = process.platform) {
28 return platform === 'win32' ? 'pnpm.cmd' : 'pnpm'

Callers 3

dev.test.mjsFile · 0.90
startDevFunction · 0.85
mainFunction · 0.85

Calls 1

setMethod · 0.65

Tested by

no test coverage detected