@bradgarropy/plop-helper-includes
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

💧 plop helper includes

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

💻 📖 ⚠️ 🚇

Package Sidebar

Install

npm i @bradgarropy/plop-helper-includes

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

8.29 kB

Total Files

6

Last publish

Collaborators

  • bradgarropy