How does registerHelper of handlebars customize a loop?

  node.js, question

I now have a requirement: define a custom tag, this tag will return an array from the database query data, how to write?

Functions similar to each:
{{#each users}}

<li></li>

{{/each}}

Change to
{{#findUsers}}
<li></li>
{{/findUsers}}

Synchronization

Handlebars.registerHelper('findUsers', function (options) {
 var users = [
 {name: 'xxx', id: 2},
 {name: 'yyy', id: 3}
 ];
 
 var ret = '';
 
 users.forEach(function (user) {
 Ret = ret plus options.fn(user);
 });
 
 return ret;
 });
 
 {{#findUsers}}
 <a href="{{id}}">{{name}}</a>
 {{/list}}

Asynchronous

Handlebars.registerAsyncHelper('findUsers', function (options,callback) {
 var users = [
 {name: 'xxx', id: 2},
 {name: 'yyy', id: 3}
 ];
 
 var ret = '';
 
 users.forEach(function (user) {
 Ret = ret plus options.fn(user);
 });
 
 callback(ret);
 });
 
 {{#findUsers}}
 <a href="{{id}}">{{name}}</a>
 {{/list}}