
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
json-template-builder
Advanced tools
The easiest way to create template (for example Vue template) from JSON object.
Also you can build DOM tree with it.
npm install json-template-builder
createTree() - function.
1 argument - JSON object
returns DOM tree
treeToStringTemplate() - function.
2 arguments: DOM tree & parent tag
returns string representation of a given DOM tree wrapped in parent tag (default <template>)
json object example:
let model = {
el: {
tag: 'div',
attrs: {'class': 'body-1', 'style': 'color: red;'},
children: [
{
{
tag: 'span',
children: 'example text'
}
}
]
}
};
minimal model:
let model = {
el: {}
}
It`s equal to <div></div>.
tag - any js string which supported by HTML as tag-name; if empty then <div>.
attrs - object with pairs key-value, key is attribute name, value is attribute value; can be empty.
children - string or Array. if string use it as innerHTML of node. If Array - creates children nodes. Can be empty.
Root node in model should only be one and called as el.
import {createTree, treeToStringTemplate} from 'json-template-builder';
FAQs
Easy way to create template (e.g. Vue Template) from JSON.
We found that json-template-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.