Skip to content
Δt stream adapter - async & dynamic templating engine
CoffeeScript JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src
.gitignore
.npmignore
Cakefile
LICENSE
README.md
dt-stream.js
package.json

README.md

Δt Stream Adapter

This is a stream adapter for Δt.

Installation

$ npm install dt-stream

Usage

var Template = require('dynamictemplate').Template;
var streamify = require('dt-stream');

var template = streamify(new Template({schema:5, pretty:true}, function () {
    this.$html(function () {
        this.$body("hello world");
    });
}));

template.stream.pipe(process.stdout);

/* → stdout:
<html>
  <body>
    hello world
  </body>
</html>
*/

api

Returns a normal nodejs stream and emits the template as string data.

Δt is already packed with a simple render function to use this adapter to stream templates out through for example a http request.

Note

Unfortunatily this disables the ability to change the template after it was rendered, but asyncronious operations like filesystem io still works pretty well.

Something went wrong with that request. Please try again.