
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
DOMlette is a very small (300B) library for when you need to generate DOM from JavaScript. It is aimed at situations where new DOM nodes are being created, and as such, is not appropiate for frequently re-rendered UI. For such tasks, consider Preact or React.
Takes an an array of elements and outputs a node with the appropriate children attached
Parameters
$0
{Array} the {Domlette} to turn into a {Node}$0
[0] name {String} this is the node name such as 'div'
, 'a'
or 'p'
$0
[1] attrs {Object} these are the attributes of the object you want to set.$0
[2] children {Array} an array of {Domlette} or {String} to append as children$0
[3] onMount {function} a callback to be called with the node reference once the node has been added to its
parentReturns Node a DOM Node created from the {Domlette} passed in
Mount an {Array} of {Domlette}s to the parent node
Parameters
parent
{Node} the parent node to append toelements
{Array} the Domlettes to append to the parentlet hiddenNode = null;
mount(document.body, [
['div', { class: 'container' }, [
['style', {}, ['.hidden{ display: none }']],
['h1', {}, ['Title']],
['p', {}, [
'Lorem Ipsum is simply dummy text of the printing and typesetting industry. ',
'Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, ',
'when an unknown printer took a galley of type and scrambled it to make a type ',
'specimen book. It has survived not only five centuries, but also the leap into ',
'electronic typesetting, remaining essentially unchanged. It was popularised in ',
'the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, ',
'and more recently with desktop publishing software like Aldus PageMaker including ',
'versions of Lorem Ipsum.'
]],
['ul', {}, [
['li', {}, ['Item 1']],
['li', {}, ['Item 2']],
['li', {}, ['...']],
]],
['div', { class : 'hidden' }, ['This is a dynamic element'], (e) => { hiddenNode = e }],
['button', { onclick : () => { hiddenNode.classList.toggle('hidden') } }, ['Toggle']],
]]
]);
See example on Codepen
1.0.2 (2017-03-10)
<a name="1.0.1">fixed hinting error for es6 version</a>
FAQs
Miniscule DOM creation library
The npm package domlette receives a total of 0 weekly downloads. As such, domlette popularity was classified as not popular.
We found that domlette 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.