1.0.1 • Published 5 years ago
envalidator v1.0.1
envalidator
Express middleware to alert if any needed env variable hasn't been set.
How to install
npm install --save envalidatorHow to use
const envalidator = require("envalidator");
const app = express();
app.use(envalidator()); // This will analyze your .js using process.cwd() -the node process directory- as root path
// or
app.use(envalidator(path.dirname(__filename))); // Here it'd use this .js file's location directory as root path
// or you can specify one specific path as rootNow, if you're trying to access some process.env variable in your codebase, instead of responding your expected routes, it'll show a nice warning message.