envalidator

1.0.1 • Public • Published

envalidator

Express middleware to alert if any needed env variable hasn't been set.

How to install

npm install --save envalidator

How 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 root

Now, 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.

Package Sidebar

Install

npm i envalidator

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

5.69 kB

Total Files

7

Last publish

Collaborators

  • luispablo