@retailmenot/common-handlebars-helpers

0.5.0 • Public • Published

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

/@retailmenot/common-handlebars-helpers/

    Package Sidebar

    Install

    npm i @retailmenot/common-handlebars-helpers

    Weekly Downloads

    3

    Version

    0.5.0

    License

    MIT

    Unpacked Size

    6.36 kB

    Total Files

    6

    Last publish

    Collaborators

    • andystalick
    • brandonlilly
    • edragic
    • jaredstilwell
    • knksmith57
    • lawnsea
    • lzilioli
    • mintyfloss
    • pierceray
    • retailmenot.admin
    • sharkparty
    • shaundubs
    • zero0halo