assert-keys

assert an object has some keys

npm install assert-keys
3 downloads in the last week
36 downloads in the last month

assert-keys

asserts that some keys are present in an object

install

npm i assert-keys

example

var checkConfig = require('assert-keys')(['port', 'api_url']);

checkConfig({port: 8000, api_url: 'http://localhost:1234'}); // doesn't throw
checkConfig({port: 8000}); // throws!
npm loves you