view-engine-marko

2.0.0 • Public • Published

view-engine-marko

Marko view engine

Installation

npm install view-engine-marko --save

Usage

Enable the Marko view engine:

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

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

var template = require('view-engine').load('hello.marko');
 
// 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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    8
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    8
  • 1.0.0
    1

Package Sidebar

Install

npm i view-engine-marko

Weekly Downloads

8

Version

2.0.0

License

Apache License v2.0

Last publish

Collaborators

  • tigt
  • ryanturnquist
  • dylanpiercey
  • ryansolid
  • mlrawlings
  • agliga
  • pnidem
  • austinkelleher