A library that enhances handlebars with better file system support, templates compilation, and partials registration.
Go to file
2019-09-10 18:14:36 +02:00
test fix(core): update 2019-09-10 18:02:42 +02:00
ts update 2019-09-10 17:58:14 +02:00
.gitignore fix(core): update 2019-09-10 18:02:42 +02:00
.gitlab-ci.yml fix(core): update 2019-09-10 18:02:42 +02:00
.npmignore initial 2017-02-19 04:12:17 +01:00
.snyk fix(security): add snyk 2019-02-17 17:00:28 +01:00
npmextra.json fix(documentation): update 2019-02-17 17:02:35 +01:00
package-lock.json 2.0.8 2019-09-10 18:14:36 +02:00
package.json 2.0.8 2019-09-10 18:14:36 +02:00
README.md fix(core): update 2019-09-10 18:02:42 +02:00
tslint.json fix(documentation): update 2019-02-17 17:02:35 +01:00

@pushrocks/smarthbs

handlebars with better fs support

Status for master

build status coverage report npm downloads per month Known Vulnerabilities TypeScript node JavaScript Style Guide

Usage

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');

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

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

repo-footer