Skip to content

common, general purpose handlebars helpers used by RetailMeNot applications

Notifications You must be signed in to change notification settings

RetailMeNotSandbox/common-handlebars-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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
        ]
      }
    }]
  }
}

About

common, general purpose handlebars helpers used by RetailMeNot applications

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •