perf: add cross-engines benchmark

This commit is contained in:
harttle
2021-06-20 13:25:08 +08:00
committed by Jun Yang
parent cc9b28307c
commit cdceb25d00
28 changed files with 32097 additions and 1585 deletions
+15
View File
@@ -0,0 +1,15 @@
const { Liquid } = require('../..')
const { readFileSync } = require('fs')
const { join } = require('path')
const liquid = new Liquid({
root: join(__dirname, '../templates'),
extname: '.liquid'
})
liquid.registerFilter('url', path => `http://example.com${path}`)
module.exports = {
load: path => liquid.parse(readFileSync(path + '.liquid', 'utf8')),
render: (tpl, data) => liquid.renderSync(tpl, data)
}