How to use the bem-xjst.bemhtml.compile function in bem-xjst

To help you get started, we’ve selected a few bem-xjst examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bem / bem-xjst / bench / apply-stand.js View on Github external
var fs = require('fs');
var bemhtmlPrev = require('bem-xjst').bemhtml;
var bemhtmlNext = require('bem-xjst').bemhtml;
var dataPath = './node_modules/web-data/data';
var files = fs.readdirSync(dataPath);
var templatesPrev = bemhtmlPrev.compile(fs.readFileSync('./node_modules/web-data/templates.js', 'utf8'));
var templatesNext = bemhtmlNext.compile(fs.readFileSync('./node_modules/web-data/templates.js', 'utf8'));

var argv = require('yargs')
    .describe('bemjsons', 'amount of bemjsons (default 2000, max 2000)')
    .describe('repeats', 'amount of repeats test')
    .describe('verbose', 'verbose results')
    .help('h')
    .alias('help', 'h')
    .argv;

var sortNumbers = function(a, b) { return (a < b) ? -1 : 1; };

var test = function() {
  var timesPrev = [];
  var timesNext = [];
  var res = { compile: '', applyPrev: [], applyNext: [] };
github bem / bem-xjst / bench / apply-stand.js View on Github external
var fs = require('fs');
var bemhtmlPrev = require('bem-xjst').bemhtml;
var bemhtmlNext = require('bem-xjst').bemhtml;
var dataPath = './node_modules/web-data/data';
var files = fs.readdirSync(dataPath);
var templatesPrev = bemhtmlPrev.compile(fs.readFileSync('./node_modules/web-data/templates.js', 'utf8'));
var templatesNext = bemhtmlNext.compile(fs.readFileSync('./node_modules/web-data/templates.js', 'utf8'));

var argv = require('yargs')
    .describe('bemjsons', 'amount of bemjsons (default 2000, max 2000)')
    .describe('repeats', 'amount of repeats test')
    .describe('verbose', 'verbose results')
    .help('h')
    .alias('help', 'h')
    .argv;

var sortNumbers = function(a, b) { return (a < b) ? -1 : 1; };

var test = function() {
  var timesPrev = [];
  var timesNext = [];
  var res = { compile: '', applyPrev: [], applyNext: [] };
  var times = argv.bemjsons || 2000;

bem-xjst

Declarative Template Engine for the browser and server

MPL-2.0
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis