retrieves the value of an environment variable on system runtimes (i.e. RUNTIME.DENO, RUNTIME.BUN, or RUNTIME.NODE).
otherwise an error gets thrown on all other environments, since they do not support environment variables.
Tip
environment variables are case-insensitive.
you will probably want to normalize path variables to posix path via pathToPosixPath.
if env_var = "" (an empty string) then undefined will always be returned on system-runtime environments.
Throws
for js-workers, extensions, and web environments, an error gets thrown, as environment variables are not available.
retrieves the value of an environment variable on system runtimes (i.e. RUNTIME.DENO, RUNTIME.BUN, or RUNTIME.NODE). otherwise an error gets thrown on all other environments, since they do not support environment variables.
env_var = ""
(an empty string) thenundefined
will always be returned on system-runtime environments.Throws
for js-workers, extensions, and web environments, an error gets thrown, as environment variables are not available.
Example