switchy
v0.1.0
Published
Replace `switch` with switchy.
Downloads
717
Readme
Install
$ npm install --save switchy
Usage
const switchy = require('switchy')
const chooseFruit = switchy({
apple() {
console.log('apple')
},
peach() {
console.log('peach')
},
default() {
console.log('no idea what you want')
}
})
chooseFruit('apple')
//=> apple
chooseFruit('watermelon')
//=> no idea what you want
License
MIT © EGOIST