Skip to content

Returns a promise with a rendered handlebars file or renders template to a file

License

Notifications You must be signed in to change notification settings

tuxracer/renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

renderer

Returns a promise with a rendered handlebars file or renders template to a file

renderer(src,[dest],data)

  renderer 'templates/foo.hbs', 'public/foo.html',
    title: 'Foobar'
    name: 'Sublime'
  .then ->
    console.log 'all done!'
  renderer 'templates/foo.hbs',
    title: 'Foobar'
    name: 'Sublime'
  .then (rendered) ->
    console.log rendered

Handlebars Helpers

readFile

Read file contents into the template

  {{readFile '/path/relative/to/hbs/file.txt'}}

stringify

JSON.stringify an object into the template

  {{{stringify someobj}}}

License

MIT

About

Returns a promise with a rendered handlebars file or renders template to a file

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published