A library that enhances handlebars with better file system support, templates compilation, and partials registration.
Go to file
2017-05-02 00:19:52 +02:00
dist fix case when no tripple curly vars are present 2017-05-02 00:19:52 +02:00
test add extended variable checking 2017-05-01 16:57:53 +02:00
ts fix case when no tripple curly vars are present 2017-05-02 00:19:52 +02:00
.gitignore initial 2017-02-19 04:12:17 +01:00
.gitlab-ci.yml update gitlab ci 2017-03-14 20:15:31 +01:00
.npmignore initial 2017-02-19 04:12:17 +01:00
npmextra.json fixed async readPartialDir 2017-03-14 18:33:04 +00:00
package.json fix case when no tripple curly vars are present 2017-05-02 00:19:52 +02:00
README.md improve README 2017-02-26 02:10:54 +01:00
tslint.json add ci 2017-02-26 02:09:41 +01:00
yarn.lock fix case when no tripple curly vars are present 2017-05-02 00:19:52 +02:00

smarthbs

handlebars with better fs support

Availabililty

npm git git docs

Status for master

build status coverage report npm downloads per month Dependency Status bitHound Dependencies bitHound Code TypeScript node JavaScript Style Guide

Usage

Use TypeScript for best in class instellisense.

For further information read the linked docs at the top of this README.

Note: Why did we decide against a class based architecture?
Easy: handlebars.js is already pretty determined how things are handled internally, namely a global partial template registry It doesn't make sense to then introduce a scoped partial template approach.

import * as smarthbs from 'smarthbs'

// read all .hbs files in a directory and any child directories and use relative path as partial string identifier
smarthbs.registerPartialDir(testPartialDir)

// read all .hbs files in a particular directory and level, output them to a destination and specify a .json file to read any referenced data
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json')

MIT licensed | © Lossless GmbH | By using this npm module you agree to our privacy policy

repo-footer