# esbuild-handlebars

> an esbuild plugin to handle ... handlebars!

Latest version **1.1.0** (published 2023-06-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install esbuild-handlebars
pnpm add esbuild-handlebars
yarn add esbuild-handlebars
bun add esbuild-handlebars
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2023-06-30 |
| First published | 2023-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 112.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Albert.Pu |
| Maintainers | albert666.pu |

## Links

- npm: https://www.npmjs.com/package/esbuild-handlebars
- Repository: https://github.com/PuAlbert/esbuild-plugin-handlebars
- npm.io page: https://npm.io/package/esbuild-handlebars

## Dependencies (1)

- [handlebars](https://npm.io/package/handlebars.md) ^4.7.7

## Recent versions

- 1.1.0 (latest) — 2023-06-30
- 1.0.1 — 2023-06-30

## README

# esbuild-handlebars

## fix Cannot read properties of undefined (reading 'call') issue
(Compatible with injection of custom methods for multi-layer nesting, [the original github project](https://github.com/inqnuam/esbuild-plugin-handlebars))

> an [esbuild](https://github.com/PuAlbert/esbuild-plugin-handlebars) plugin to handle ... handlebars!

## Installation

```bash
yarn add -D esbuild-handlebars
# or
npm install -D esbuild-handlebars
```

## Usage

```js
const hbsPlugin = require('esbuild-handlebars');
const path = require('path');

module.exports = [
    hbsPlugin({
		filter: /\.(hbs|handlebars)$/i,
        additionalHelpers: {
            equal: path.join(__dirname, '/helper/template/equal'),
        },
        precompileOptions: {}
    })
];

```

You can also set additionalHelpers and precompileOptions:

```js
const hbsOptions = {
        additionalHelpers: {},
        additionalPartials: {},
        precompileOptions: {}
      }

// usual esbuild config
{
 ...
 plugins: [handlebarsPlugin(hbsOptions)],
 ...
}

```

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