views.js
This file
Path
benchmarks/views.js
56 lines · 1.2 KiB · JavaScript
Last changed by
Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
History of this fileTake it
Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption704c933
lines 1–10why, one step back12require.paths.unshift('lib')3require.paths.unshift('benchmarks')4process.mixin(GLOBAL, require('sys'))5process.mixin(GLOBAL, require('benchmark'))6require('express')78print = puts910engine = {Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
lines 11–13why, one step back11 ejs: require('ejs'),12 haml: require('haml'),13 sass: require('sass')Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption704c933
lines 14–17why, one step back14}1516options = { locals: { article: { title: 'Foo', body: 'bar' }}}17Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
lines 18–24why, one step back18ejs = ' \n\19<div id="primary"> \n\20 <div class="block first"> \n\21 <h1><%= article.title %></h1> \n\22 <p><%= article.body %></p> \n\23 </div> \n\24</div> \n\Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption704c933
lines 25–26why, one step back25'26Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
lines 27–31why, one step back27haml = ' \n\28#primary \n\29 .block.first \n\30 %h1= article.title \n\31 %p= article.body \n\Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption704c933
lines 32–33why, one step back32'33Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
lines 34–43why, one step back34sass = ' \n\35red: #ff0000 \n\36body \n\37 ul \n\38 li \n\39 a \n\40 :color !red \n\41 :list-style none \n\42'43Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption704c933
lines 44–50why, one step back44suite('Template Engines', 1000, function(){45 benchmark('ejs', function(){46 engine.ejs.render(ejs, options)47 })48 49 benchmark('haml', function(){50 engine.haml.render(haml, options)Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
lines 51–54why, one step back51 })52 53 benchmark('sass', function(){54 engine.sass.render(sass)Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption704c933
lines 55–56why, one step back55 })56})