Skip to content

jonpacker/assert-keys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

assert an object has some keys

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published