1.0.0 • Published 6 years ago
handlebars-helpers-sprintf-js v1.0.0
handlebars-helpers-sprintf-js
Wrap sprintf-js functions to Handlebars helpers
Installation
npm install handlebars-helpers-sprintf-jsUsage
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'})In webpack.config.js:
…
const helper = require('handlebars-helpers-sprintf-js');
…
precompileOptions: {
knownHelpers: helper.knownHelpers,
},
helperDirs: [
'handlebars-helpers-sprintf-js'
],
…1.0.0
6 years ago