@pennah/iffy
v1.0.2
Published
✨ Javascript "if / else" expressions ✨
Downloads
4
Maintainers
Readme
Installation
NPM
$ npm add @pennah/iffy
Yarn
$ yarn add @pennah/iffy
Usage
Simple expressions
import { If } from "@pennah/iffy";
let powerLevel = 9001;
let message = If(powerLevel > 9000, {
then: `It's over 9000!!!111`,
else: `You are no match for me`,
});
console.log(message); // It's over 9000!!!111
Nested expressions
import { If } from "@pennah/iffy";
...
const action = If(userInput === "0", {
then: () => console.log("Hello"!),
else: If(userInput === "1" {
then: () => console.log('Howdy!'),
else: () => console.log(`It's fine 🐶 🔥`)
})
});
Contributing
Feel free to open issues or pull requests.
License
Iffy uses an MIT license.