# hbs-helper

> handlebar template engine's helper

Latest version **0.0.5** (published 2015-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install hbs-helper
pnpm add hbs-helper
yarn add hbs-helper
bun add hbs-helper
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2015-11-09 |
| First published | 2015-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | chilijung |
| Maintainers | chihsuan, chilijung, ctxhou |
| Keywords | canner, handlebar, helper |

## Links

- npm: https://www.npmjs.com/package/hbs-helper
- Repository: https://github.com/Canner/hbs-helper
- Issues: https://github.com/Canner/hbs-helper/issues
- npm.io page: https://npm.io/package/hbs-helper

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2015-11-09
- 0.0.4 — 2015-11-05
- 0.0.3 — 2015-10-22
- 0.0.2 — 2015-10-22
- 0.0.1 — 2015-10-22

## README

# hbs helper

this repo list some hbs helpers.

maybe you will need it when you create the can.

## default helpers

### ifCond.js

if condition.

example:

```hbs
    {{#ifCond v1 '>=' v2}}
        show when true
    {{/ifCond}}
```

please read the code to know more.

### multiOr.js

compare multiple variable with 'or' condition

example:

```hbs
    {{#multiOr var1 var2 var3 var4}}
        show text when one of var is true
    {{/multiOr}}
```

You can use as many variables as you can.

### ifEven.js

Even

example:

```hbs
  {{#each item}}
    {{#ifEven @index}}
        show if even
    {{/ifEven}}
  {{each}}
```

### ifOdd.js

Odd

example:

```hbs
  {{#each item}}
    {{#ifOdd @index}}
        show if even
    {{/ifOdd}}
  {{each}}
```

## other helpers

### gridValue.js

use to return the proper string based on the different length of array.

For example:

    {{gridValue 1}} => "col-md-12 sm-col-12"
    {{gridValue 5}} => "col-md-3 sm-col-6"

You can change the different grid value in your canner can.

### gridValueKey.js

use to return the proper string based on the existing key.

For example:

now has these key-value => a: false, b: true, c: true

    {{gridValueKey a b c}} => "col-md-6 sm-col-6" //cause the true key is b & c

You can change the different grid value in your canner can.

---
_Source: https://npm.io/package/hbs-helper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
