0.5.0 • Published 4 years ago

@retailmenot/common-handlebars-helpers v0.5.0

Weekly downloads
57
License
MIT
Repository
github
Last release
4 years ago

@retailmenot/common-handlebars-helpers

Build Status

common, general purpose handlebars helpers used by RetailMeNot applications

Quickstart

$ npm install --save @retailmenot/common-handlebars-helpers

Then, in your application:

const commonHelpers = require('@retailmenot/common-handlebars-helpers')
const handlebars = require('handlebars')

handlebars.registerHelper(commonHelpers)

Webpack

For use in the browser via webpack, use the handlebars-loader module add this package's helpers directory to the helpersDir config array:

// webpack.config.js
const path = require('path')
const handlebarsLoader = require('handlebars-loader')

const moduleDirectory = path.dirname(require.resolve('@retailmenot/common-handlebars-helpers'))
const helpersDirectory = path.join(moduleDirectory, 'helpers')

module.exports = {

  // entry, output ...

  module: {
    loaders: [{
      test: /\.hbs$/,
      loader: handlebarsLoader,
      query: {
        helperDirs: [
          helpersDirectory
        ]
      }
    }]
  }
}
0.5.0

4 years ago

0.4.4

4 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

7 years ago