- Notifications
You must be signed in to change notification settings - Fork0
A plop helper that conditionally renders if an array includes a value.
License
NotificationsYou must be signed in to change notification settings
bradgarropy/plop-helper-includes
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Aplop
helper that determines if an array includes a value.
This package is hosted onnpm.
npm install @bradgarropy/plop-helper-includes
First, be sure you haveplop
installed. Then, add the following line to yourplopfile.js
.
plop.load("@bradgarropy/plop-helper-includes")
Once loaded, you now have access the following helpers.
Conditional template based on if an array includes a string.
{toppings:["pepperoni","onions"]}
{{#includestoppings"pepperoni"}} pepperoni{{else}} no pepperoni{{/includes}}{{#includestoppings"onions"}} onions{{else}} no onions{{/includes}}
pepperonionions
🐛 report bugs by filingissues
📢 provide feedback withissues or ontwitter
🙋🏼♂️ use myama ortwitter to ask any other questions
Brad Garropy 💻📖 |
About
A plop helper that conditionally renders if an array includes a value.