Yeah so essentially what you want is to do is create an equals template helper, here are a couple resources from the past:

I'm trying to print out a specific custom variable value of mine in the account stats row. Specifically "customFields" is an array that contains a name/value pairs of custom fields. I'd like to print out the customField with the name "karma" (if it exist...
faviconCommunity (community.nodebb.org)
https://community.nodebb.org/topic/3554/how-to-create-and-use-a-template-helper/9
And the benchpress docs
https://github.com/benchpressjs/benchpressjs/blob/master/docs/readme.md