UNPKG
cli-html
Version:
latest (4.4.0)
4.4.0
4.3.1
4.3.0
4.2.0
4.1.0
4.0.7
4.0.6
4.0.5
4.0.4
4.0.3
4.0.1
4.0.0
3.0.11
3.0.10
3.0.8
3.0.7
3.0.6
3.0.5
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.1.8
2.1.7
2.1.6
2.1.5
2.1.4
2.1.3
2.1.2
2.1.1
2.1.0
2.0.1
2.0.0
1.9.4
1.9.2
1.9.1
1.8.4
1.8.2
1.8.1
1.8.0
1.7.0
1.6.0
1.5.8
1.5.7
1.5.6
1.5.5
1.5.4
1.5.3
1.5.2
1.5.1
1.4.0
1.3.0
1.2.0
1.1.0
1.0.1
1.0.0
0.0.1
Render HTML to Terminal
github.com/grigorii-horos/cli-html
grigorii-horos/cli-html
cli-html
/
lib
/
utils
/
render-tag.js
9 lines
(6 loc)
•
237 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
import
tags
from
'../tags.js'
;
export
const
renderTag
= (
node, context, defaultTag = tags.div
) => {
const
tagFunction = tags[node.
nodeName
||
'#text'
] || defaultTag;
const
nodeTag =
tagFunction
(node, context);
return
nodeTag; };