Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

This package has been deprecated

Author message:

Use view-engine-marko instead

view-engine-raptor

0.1.5-beta • Public • Published

view-engine-raptor

Raptor Templates view engine

Installation

npm install view-engine-raptor --save

Usage

Enable the Raptor Templates view engine:

require('view-engine').configure({
    engines: {
        'view-engine-rhtml': {
            extensions: ['rhtml']
        }
    }
})

The Raptor Templates view engine is now ready to be used elsewhere in your code:

var template = require('view-engine').load('hello.rhtml');
 
// Callback-style
template.render({ name: 'John'}, function(err, data) {
    if (err) {
        console.log('Failed to render: ' + err);
        return;
    }
 
    console.log('Output: ' + data);
});
 
// Streaming-style
var out = require('fs').createOutputStream('hello.out', {encoding: 'utf8'});
template.stream({ name: 'John'}).pipe(out);
 
// Render to an existing render context
template.render({ name: 'John'}, context);

See the documentation for the view engine module for more information.

install

npm i view-engine-raptor

Downloadsweekly downloads

1

version

0.1.5-beta

license

Apache License v2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar