Skip to content
BEMJSON to HTML serializer
JavaScript
Branch: master
Clone or download
apostololeg Merge pull request #2 from truerenton/zero_vals
should not ignore zero mod values
Latest commit 1dd1958 Nov 18, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bemjsons Added trivial benchmark Jul 22, 2014
benchmark Update devDependencies and readme Nov 30, 2014
profile Found deoptimization Jul 21, 2014
test fix for zero values Nov 16, 2015
.editorconfig First version Jul 21, 2014
.gitignore First version Jul 21, 2014
.jshintrc First version Jul 21, 2014
.npmignore First version Jul 21, 2014
.travis.yml First version Jul 21, 2014
README.md Update devDependencies and readme Nov 30, 2014
escape.js First version Jul 21, 2014
index.js fix for zero values Nov 16, 2015
package.json 0.3.0 Nov 11, 2015

README.md

bemjson-to-html NPM version Build Status Dependency Status

BEMJSON to HTML serializer

This is optimized part of jsot-bh for generation HTML from constructed BEMJSON.

API

new BEMJSON([options])

Creates serializer object.

Options:

  • jsAttrScheme Boolean - If js, attribute with js params will be prefixed with return (default: js).
  • jsAttrName String - Specifies name of attribute, that will contain jsParams (default: onclick).
  • defaultTag String - Default tag name for block without tag property (default: div).

BEMJSON.toHtml(bemjson)

Returns serialized HTML string.

Benchmark

trivial
4,133,717 op/s » bemjson-to-html
2,371,357 op/s » bh

simple
109,658 op/s » bemjson-to-html
78,604 op/s » bh

full
27,264 op/s » bemjson-to-html
23,367 op/s » bh

stringify
1,508,587 op/s » stringify (no escaping)
843,899 op/s » stringify (escaped with replace)
388,025 op/s » stringify (escaped)
312,156 op/s » bemjson-to-html
220,219 op/s » bh

License

MIT (c) Vesvolod Strukchinsky

You can’t perform that action at this time.