html2bemjson
Converts HTML to BEMJSON.
Installation
npm install html2bemjson --save
Usage
var html2bemjson = ;var html = '<div class="b1"><div class="b1__elem1"></div></div>'; html2bemjson; // BEMJSON object html2bemjson;// {// block: 'b1',// content: [// {// block: 'b1',// elem: 'elem1'// }// ]// }
Options
Both methods can take options object as a second argument:
;
For more examples please refer to test
folder.