{"size": 796, "ext": "js", "max_stars_repo_path": "examples/view-render.js", "max_stars_repo_name": "jonschlinkert/template", "max_stars_repo_stars_event_min_datetime": "2015-01-13T18:29:00.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-17T07:23:04.000Z", "max_issues_repo_path": "examples/view-render.js", "max_issues_repo_name": "jonschlinkert/template", "max_issues_repo_issues_event_min_datetime": "2015-02-13T00:48:48.000Z", "max_issues_repo_issues_event_max_datetime": "2017-10-23T21:58:33.000Z", "max_forks_repo_path": "examples/view-render.js", "max_forks_repo_name": "jonschlinkert/template", "max_forks_repo_forks_event_min_datetime": "2015-03-09T13:50:36.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-14T21:39:24.000Z"}
{"max_stars_count": 41, "max_issues_count": 28, "max_forks_count": 9, "avg_line_length": 22.1111111111, "max_line_length": 82, "alphanum_fraction": 0.5979899497}
'use strict';

var App = require('..');
var app = new App();

app.engine('tmpl', require('engine-lodash'));

/**
 * Create a view collection
 */
app.create('pages');

/**
 * Load views onto the collection you created
 */

app.page('welcome.tmpl', {path: 'welcome.tmpl', content: 'Hello, <%= name %>!'})
  .page('goodbye.tmpl', {path: 'goodbye.tmpl', content: 'Goodbye, <%= name %>!'});

// get a template
var page = app.pages.get('welcome.tmpl');

// render a template
page.render({name: 'Bob'}, function (err, res) {
  if (err) return console.log(err);
  console.log(res.content);
  //=> 'Hello, Bob!'

  app.pages.get('goodbye.tmpl')
    .render({name: 'Bob'}, function (err, res) {
      if (err) return console.log(err);
      console.log(res.content);
      //=> 'Goodbye, Bob!'
    });
});
