pixsy/node_modules/pug/examples/extend.js

18 lines
389 B
JavaScript
Raw Normal View History

2017-12-22 17:22:08 +00:00
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/extend.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
var tobi = { name: 'tobi', age: 2 };
var loki = { name: 'loki', age: 1 };
var jane = { name: 'jane', age: 5 };
console.log(fn({
title: 'pets'
, pets: [tobi, loki, jane]
}));