Send easy search data from a template to a js file

Something like:

{{#EasySearch.Each index=UsersIndex}}
   <li>{{profile.firstname}}</li> <!--Send this filtered data to another js file -->
{{/EasySearch.Each}}

It is possible to do that?