Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itsthatguy/sails-hook-handlebars


https://github.com/itsthatguy/sails-hook-handlebars

Last synced: about 6 hours ago
JSON representation

Awesome Lists containing this project

README

        

# sails-hook-handlebars

Allows using handlebars on the backend for templating dynamic data. (for use with sailsjs)

## installation:

```
npm install sails-hook-handlebars --save
```

## usage:

```javascript
sails.hook.handlebars.render(, );
```

## example:

### template file

```handlebars
{{!-- assets/templates/myTemplate.hbs --}}

Hello. My name is {{name}}.
```

### javascript file

```javascript
sails.hook.handlebars.render('myTemplate', {name: "Kevin"});
```