
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
create-html-element
Advanced tools
Create a HTML element string
npm install create-html-element
import createHtmlElement from 'create-html-element';
createHtmlElement({
name: 'h1',
attributes: {
class: 'unicorn',
rainbow: true,
horse: false,
number: 1,
multiple: [
'a',
'b'
]
},
html: '🦄'
});
//=> '<h1 class="unicorn" rainbow number="1" multiple="a b">🦄</h1>'
createHtmlElement({text: 'Hello <em>World</em>'});
//=> '<div>Hello <em>World</em></div>'
Type: object
Type: string
Default: 'div'
HTML tag name.
Type: object
HTML tag attributes.
HTML tag value in unescaped HTML.
This option is mutually exclusive with the text and children options.
HTML tag value in escaped HTML.
This option is mutually exclusive with the html and children options.
Type: Array<string|object>
HTML tag children.
Strings are escaped, objects are passed to createHtmlElement.
This option is mutually exclusive with the html and text options.
import createHtmlElement from 'create-html-element';
createHtmlElement({
name: 'div',
children: [
'<unsafe>',
{
name: 'iframe',
attributes: {
src: 'https://example.com'
}
},
{
name: 'span',
text: 'Label here <em>plz</em>'
}
]
});
//=> '<div><unsafe><iframe src="https://example.com"></iframe><span>Label here <em>plz</em></span></div>'
FAQs
Create a HTML element string
The npm package create-html-element receives a total of 1,766 weekly downloads. As such, create-html-element popularity was classified as popular.
We found that create-html-element demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.