ejs-stream

    1.0.0 • Public • Published

    ejs-stream

    A through stream for rendering objects with ejs templates

    npm install ejs-stream
    

    Usage

    Pass a template as first argument to the constructor. The second options map is passed to the ejs compile function.

    var ejs = require('ejs-stream');
     
    var stream = ejs('Hello <%- name %>');
     
    stream.write({ name: 'you' });
    stream.end();

    Or piping from a readable stream.

    var ejs = require('ejs-stream');
    var mongojs = require('mongojs');
     
    var db = mongojs('...', ['customers']);
     
    db.customers.find()
        .pipe(ejs('<%- address %> <%- name %>'))
        .pipe(process.stdout);

    Install

    npm i ejs-stream

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • kapetan