Check environment variables before node.js app starts
Sanity.js is a small library that checks a list of environment variables are set and meet your format requirements before your app starts up.
Here's a quick snippet of how it could be used:
var sanity = require('sanity');
sanity.check(['USER', 'MACHTYPE', 'INVISIBLE_FRIENDS', 'AREA_51']);
// Output if INVISIBLE_FRIENDS and AREA_51 are undefined
ERROR: Required settings are not correct!
INVISIBLE_FRIENDS: undefined
AREA_51: undefined
Full documentation (and tests!) are a the sanity repo.
Written by Adam Yanalunas
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Node
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#