New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dt-stream

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

dt-stream

Δt stream adapter - async & dynamic templating engine

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

Δ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.

Keywords

dt

FAQs

Package last updated on 21 Aug 2014

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