@anthropic-ai/sdk
Version:
The official TypeScript library for the Anthropic API
17 lines • 523 B
JavaScript
/**
* Read an environment variable.
*
* Trims beginning and trailing whitespace.
*
* Will return undefined if the environment variable doesn't exist or cannot be accessed.
*/
export const readEnv = (env) => {
if (typeof globalThis.process !== 'undefined') {
return globalThis.process.env?.[env]?.trim() || undefined;
}
if (typeof globalThis.Deno !== 'undefined') {
return globalThis.Deno.env?.get?.(env)?.trim() || undefined;
}
return undefined;
};
//# sourceMappingURL=env.mjs.map