Skip to content

MarkTiedemann/throw-if-missing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

throw-if-missing

Enforce required parameters or options in ES6.

Based on An Easier Way to Enforce Required Parameters in ES6.

Installation

npm install throw-if-missing

Quickstart

const x = require('throw-if-missing')

const login = ({ username = x`username`, password = x`password` } = {}) => {}

login({ username: 'C-3PO' }) // ==> Error: Missing password

License

WTFPL – Do What the F*ck You Want to Public License.

Made with ❤️ by @MarkTiedemann.

About

Enforce required parameters or options in ES6.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published