rogain-parser
Parses html strings with rogain flavor into JSON-compatible rogain trees. Uses htmlparser2 for initial pass, then walks the outputed tree searching for components (Uppercase elements) and variables (demarcated using {}
).
Example
;
parse(template[, options])
Parses template into json tree with options to configure the htmlparser2 parser and handler, returns a Promise resolving a rogain tree.
template
String. Rogain template.
options
Object. Optional. Used with the htmlparser2 module.
opts.parserOptions
are options sent to the htmlparser parser.
opts.handlerOptions
are options sent to the htmlparser default handler.
Install
With npm do:
npm install rogain-parser
License
MIT