Patrick Steele-Idem b65c90c247 Update README.md
2014-03-19 07:39:14 -07:00
2014-01-24 15:10:21 -07:00
2014-01-24 15:10:21 -07:00
2014-03-14 16:39:54 -06:00
2014-03-19 07:39:14 -07:00

raptor-render-context

The raptor-render-context module makes it possible to asynchrously render to the same output stream or writer. The raptor-render-context module does the hard work of ensuring that the output bytes are flushed in the correct order. Content that is rendered before it is ready to be flushed is buffered and immediately flushed as soon it is ready.

Installation

npm install raptor-render-context --save

Usage

var through = require('through');

var output = '';
var stream = through(function write(data) {
        output += data;
    });

var context = require('raptor-render-context').create(stream)
    .on('error', function(err) {
        // Something went wrong during rendering
    })
    .on('end', function() {
        // Value of output: "ABC"
    });
    
context.write('A');

var asyncContext = context.beginAsync();
setTimeout(function() {
    asyncContext.write('B');
    asyncContext.end();
}, 1000);

    
context.write('C');
context.end();
Description
A declarative, HTML-based language that makes building web apps fun
Readme MIT 72 MiB
Languages
JavaScript 65.4%
TypeScript 21.3%
Marko 7%
HTML 6.3%