🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

stream-handlebars

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-handlebars

Extends handlebars with a streaming interface for .compile()

0.2.0
latest
Source
npm
Version published
Weekly downloads
12K
120.94%
Maintainers
1
Weekly downloads
 
Created
Source

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
[options]objectoptions passed to both Transform() and .compile()
[options.objectMode]objectset to true if you wish you pass in the data as an object
[options.data]objectdefault data object

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

Keywords

handlebars

FAQs

Package last updated on 27 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts