stream-handlebars
Extends handlebars with a streaming interface for .compile()
Last updated 10 years ago by 75lb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install stream-handlebars 
SYNC missed versions from official npm registry.

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

Param Type Description
template string required template
[options] object options passed to both Transform() and .compile()
[options.objectMode] object set to true if you wish you pass in the data as an object
[options.data] object default data object

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

Current Tags

  • 0.2.0                                ...           latest (10 years ago)

8 Versions

  • 0.2.0                                ...           10 years ago
  • 0.1.6                                ...           11 years ago
  • 0.1.5                                ...           11 years ago
  • 0.1.4                                ...           11 years ago
  • 0.1.3                                ...           11 years ago
  • 0.1.2                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |