apeman-commons-templating

apeman common module for templating.

Usage no npm install needed!

<script type="module">
  import apemanCommonsTemplating from 'https://cdn.skypack.dev/apeman-commons-templating';
</script>

README

apeman-commons-templating

Build Status Code Climate Code Coverage npm version

apeman common module for templating.

Installation

Install module via npm.

# Install as local module.
$ npm install apeman-commons-templating --save

Usage

Create bud renderable.

Create bud renderable object.

var templating = require('apeman-commons-templating');

var renderer = templating.budRenderer({
    'public/{{username}}.txt': {
        force: true,
        mkdirp: true,
        mode: 466,
        tmpl: "Hi, my name is {{username}}"
    }
});
renderer.render({
    username: "John"
}, function () {
    /*...*/
});

Resolve template.

Resolve a template file path.

var templating = require('apeman-commons-templating');


var resolver = templating.tmplResolver('src/templates');

var filename = resolver('hbs/foo.txt.hbs');

License

This software is released under the MIT License.

Links