Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
assert an object has some keys
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
README.md
ak.js
package.json

README.md

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!
Something went wrong with that request. Please try again.