n8nhackers / n8n-nodes-document-generator

This node renders Handlebars templates for documents or emails
MIT License
25 stars 7 forks source link

Add some simple helpers for compare statements #5

Closed qroac closed 6 months ago

qroac commented 1 year ago

Describe the function you would like to have

First, thanks for your great work!

I just started to use this extension in a flow receiving new contact objects from CRM and parsing VCard files. For example parsing the lines for Mail and Phone, there are a lot IFs and ELSEs. And there the use of the default handlebars feature set is already insufficient. There are no compare helpers to check a string for equality for things like: {{#if (eq type "Office")}}voice,work{{/if}}

It would be great if you could add some handlebar helpers for comparing values.

Describe your current alternative solution.

No response

mcolomer commented 6 months ago

Hi @qroac

A new version with helpers was added. The new handlebars library is using this library https://github.com/jaredwray/fumanchu

Additionally, I have added some extra information on README as well as sample_workflow.json in the root folder.

Hope this fixes any issues.

Take care.