An environment validator for Node.js applications - serving as a "pre-loader" of sorts - to ensure that environment variables are configured, dependencies are installed, and utility versions are satisfied.
RuntimeGuard is a faithful fork and continuation of Eos, a runtime pre-loader created by Dannington for application dependency compliance.
-
Clone the RuntimeGuard repository into your project and rename
src/
toruntimeguard/
. -
Create a
rg.conf.js
(or another name) file in your project's root directory (an example rg.conf.js is included in this repository for reference and documentation). -
Run
npm install
oryarn install
inruntimeguard/
. -
Create an entrypoint file (using any name; e.g. index.js/bootstrapper.js/whatever.js) and add the following content to it:
process.rg_conf_path = __dirname + "/rg.conf.js"; // Replace rg.conf.js with the name of your RuntimeGuard configuration file
require("./runtimeguard").runtime(); // Start RuntimeGuard
- Change
package.json
to point your main file entry to the RuntimeGuard entrypoint.