keithamus / hbs-cli

A CLI for handlebars
43 stars 26 forks source link

Unable to import handlebars-helpers #63

Open ProfessorManhattan opened 3 years ago

ProfessorManhattan commented 3 years ago

When I run hbs --helper handlebars-helpers I get the following issue:

WARNING: /home/hawkwood/androidstudio/node_modules/handlebars-helpers/index.js does not export a 'register' function, cannot import
Error: Missing helper: "eq"

Any idea on how I can import all of the handlebars-helpers functions with this?

keithamus commented 3 years ago

You would have to make a file that registers them, for example:

//handlebars-helpers.js
module.exports.register = function (Handlebars) {
  require('handlebars-helpers')(Handlebars)
}

Then run with that file instead:

hbs --helper ./handlebars-helpers.js