Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
create-element-basic
Advanced tools
HTML element string creation
npm i create-element-basic --save
var createElement = require('create-element-basic');
createElement(htmlTag[string], attributes[object], content[string || function])
Breaking Change !
createElement will now determine if the htmlTag entered is empty or not. No longer necessary to enter a Boolean (true/false) as the second argument.
Examples
// Before:
createElement('a', true, {href: 'http://www.apple.com'}, "Apple");
createElement('img', false, {src: "foo.png"});
// Now:
createElement('a', {href: 'http://www.apple.com'}, "Apple");
createElement('img', {src: "foo.png"});
yields:
<a href="http://www.apple.com">Apple</a>
<img src="foo.png" />
You can nest functions to create complex components.
var closeAria = createElement('span', {'aria-hidden': true}, '×')
+ createElement('span', {class: 'sr-only'}, 'Close')
var close = createElement('button', {
class: 'close',
type: 'button',
'data-dismiss': 'alert'
}, closeAria)
var element = createElement('div', extend({
class: modifier
}, hash), close + 'One more time for the Gipper.')
return element
yields:
<div class="alert alert-info alert-raised fade in">
<button class="close" type="button" data-dismiss="alert">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
One more time for the Gipper.
</div>
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Keith Williams
Copyright (c) 2014-2015 Keith Williams
Released under the MIT license
FAQs
HTML element string creation
We found that create-element-basic 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.