handlebars-helpers-sprintf-js

1.0.0 • Public • Published

handlebars-helpers-sprintf-js

Wrap sprintf-js functions to Handlebars helpers

Installation

npm install handlebars-helpers-sprintf-js

Usage

Typical

Register helpers:

const helper = require('handlebars-helpers-sprintf-js');
 
helper.register();

Use:

const Handlebars = require('handlebars');
 
const template = Handlebars.compile('{{sprintf format param}}');
 
template({format: '%s', param: 'a'})

handlebars-loader

In webpack.config.js:

const helper = require('handlebars-helpers-sprintf-js');
                        precompileOptions: {
                            knownHelpers: helper.knownHelpers,
                        },
                        helperDirs: [
                            'handlebars-helpers-sprintf-js'
                        ],

Package Sidebar

Install

npm i handlebars-helpers-sprintf-js

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

5.7 kB

Total Files

10

Last publish

Collaborators

  • tomi77