keithamus / hbs-cli

A CLI for handlebars
43 stars 26 forks source link

Unable to import handlebars-helpers #63

Open ProfessorManhattan opened 2 years ago

ProfessorManhattan commented 2 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 2 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