Build once, deploy anywhere. Startup/runtime environment variable solution for JavaScript.
npm install @runtime-env/cli``sh`
$ npm i -D @runtime-env/cli
$ npx -p @runtime-env/cli runtime-env --help
`
Usage: runtime-env [options] [command]
Options:
-V, --version output the version number
--global-variable-name
--schema-file
--watch turn on watch mode (default: false)
-h, --help display help for command
Commands:
gen-js [options] generate a JavaScript file that includes environment variables within an object, making them
accessible through the globalThis property
gen-ts [options] generate a TypeScript file that provides the corresponding type definitions for the JavaScript
file generated by the gen-js command
interpolate [options] perform template interpolation by substituting environment variables
help [command] display help for command
`
$ npx -p @runtime-env/cli runtime-env gen-js --help
`
Usage: runtime-env gen-js [options]
generate a JavaScript file that includes environment variables within an object, making them accessible through the globalThis property
Options:
--env-file
--output-file
-h, --help display help for command
`
$ npx -p @runtime-env/cli runtime-env gen-ts --help
`
Usage: runtime-env gen-ts [options]
generate a TypeScript file that provides the corresponding type definitions for the JavaScript file generated by the gen-js command
Options:
--output-file
-h, --help display help for command
`
$ npx -p @runtime-env/cli runtime-env interpolate --help
`
Usage: runtime-env interpolate [options]
perform template interpolation by substituting environment variables
Options:
--env-file
--input-file
--output-file
-h, --help display help for command
``