# handlebars-load-tree

> Load handlebars templates and partials from a directory, recursively.

Latest version **0.10.3** (published 2016-10-07) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install handlebars-load-tree
pnpm add handlebars-load-tree
yarn add handlebars-load-tree
bun add handlebars-load-tree
```

## 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.10.3 |
| Published | 2016-10-07 |
| First published | 2014-03-25 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Nathan Stott |
| Maintainers | nathan, soitgoes |
| Keywords | handleabars, loader, directory |

## Links

- npm: https://www.npmjs.com/package/handlebars-load-tree
- npm.io page: https://npm.io/package/handlebars-load-tree

## Dependencies (3)

- [walkdir](https://npm.io/package/walkdir.md) 0.0.7
- [bluebird](https://npm.io/package/bluebird.md) ~1.1.0
- [underscore](https://npm.io/package/underscore.md) ~1.6.0

## Recent versions

- 0.10.3 (latest) — 2016-10-07
- 0.10.1 — 2016-10-07
- 0.10.0 — 2016-09-25
- 0.9.0 — 2014-03-25

## README

# Handlebars Load Tree

The handlebars tree loader exposes one function which will walk a directory tree, recursively,
compiling handlebars templates.

[**handlebars_demo.js**](https://github.com/nrstott/handlebars-load-tree/blob/master/handlebars_demo.js)

    var path = require('path');

    var Handlebars = require('handlebars');
    var handlebarsLoadTree = require('handlebars-load-tree');

    var views = handlebarsLoadTree(Handlebars, path.join(__dirname, 'spec', 'fixtures'));

    var locals = {
      title: 'Titles are Nice',
      items: [
        {
          text: 'Buy Milk'
        },
        {
          text: 'Pick up Prescription'
        },
        {
          text: 'Read PDF'
        }
      ]
    };

    views.call('index_vanilla', locals).then(console.log);

## Handlebars-Layouts

This plugin also works with handlebars-layouts as handlebars-layouts modified
the Handlebars instance. Load handlebars-layouts normally and pass the modified
Handlebars to `handlebarsLoadTree`.

[**handlebars_layouts_demo.js**](https://github.com/nrstott/handlebars-load-tree/blob/master/handlebars_layouts_demo.js)

    var path = require('path');

    var Handlebars = require('handlebars');
    require('handlebars-layouts')(Handlebars);

    var handlebarsLoadTree = require('handlebars-load-tree');

    var views = handlebarsLoadTree(Handlebars, path.join(__dirname, 'spec', 'fixtures'));

    var locals = {
      title: 'Titles are Nice',
      items: [
        {
          text: 'Buy Milk'
        },
        {
          text: 'Pick up Prescription'
        },
        {
          text: 'Read PDF'
        }
      ]
    };

    views.call('index', locals).then(console.log);

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