0.2.0 • Published 8 years ago

stream-handlebars v0.2.0

Weekly downloads
574
License
MIT
Repository
github
Last release
8 years ago

view on npm npm module downloads per month Build Status Dependency Status js-standard-style

stream-handlebars

Extends handlebars with a streaming interface for .compile().

Example

var handlebars = require('stream-handlebars')
var fs = require('fs')

var template = '<p>\{{paragraph}}</p>'

// it's just regular handlebars..
handlebars.registerPartial('whatever', 'the partial content')

// ..with the addition of a streaming interface for .compile()
var compileStream = handlebars.createCompileStream(template)

// the template is compiled using the piped-in JSON as context
fs.createReadStream('./template-data.json', 'utf8')
    .pipe(compileStream)
    .pipe(process.stdout)

handlebars : object

The regular handlebars module.

Kind: Exported namespace
Extends: handlebars

handlebars.createCompileStream(template, options) ⇒ Transform

a stream wrapper for the handlebars.compile function

Kind: static method of handlebars

ParamTypeDescription
templatestringrequired template
optionsobjectoptions passed to both Transform() and .compile()
options.objectModeobjectset to true if you wish you pass in the data as an object
options.dataobjectdefault data object

© 2015-16 Lloyd Brookes \75pound@gmail.com\. Documented by jsdoc-to-markdown.

0.2.0

8 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago