๐Ÿ’ง plop helper includes

September 12, 2022 ยท View on GitHub

version downloads size github actions coverage typescript contributing contributors discord

A plop helper that determines if an array includes a value.

๐Ÿ“ฆ Installation

This package is hosted on npm.

npm install @bradgarropy/plop-helper-includes

๐Ÿฅ‘ Usage

First, be sure you have plop installed. Then, add the following line to your plopfile.js.

plop.load("@bradgarropy/plop-helper-includes")

Once loaded, you now have access the following helpers.

includes

Conditional template based on if an array includes a string.

input

{
    toppings: ["pepperoni", "onions"]
}

helper

{{#includes toppings "pepperoni"}}
    pepperoni
{{else}}
    no pepperoni
{{/includes}}
{{#includes toppings "onions"}}
    onions
{{else}}
    no onions
{{/includes}}

output

pepperoni
onions

โ” Questions

๐Ÿ› report bugs by filing issues
๐Ÿ“ข provide feedback with issues or on twitter
๐Ÿ™‹๐Ÿผโ€โ™‚๏ธ use my ama or twitter to ask any other questions

โœจ contributors


Brad Garropy

๐Ÿ’ป ๐Ÿ“– โš ๏ธ ๐Ÿš‡