Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
< 1KB library for DOM selections in JavaScript
Development Version Production Version
Even though it's used less and less, jQuery is still used a lot for its single function that does a lot of different DOM operations. With the increasing browsers support for simple features, some of jQuery's cross-browser compatibility methods have become outdated. This library is made to make it easy to do anything with the DOM, but still use the (much faster) vanilla DOM methods.
dom$ supports a lot of browsers, even back to IE8! It's an easy way to create, modify, and find DOM elements dynamically.
This library also works well with the Stream.js library.
Setting all headers to blue:
dom$('h1, h2, h3, h4, h5').each(function (elem) {
elem.style.color = 'blue'; // using `this` would also work here
});
Adding 2 DOM elements, then using Stream.js to find ones with a certain class:
var text = dom$('p.text');
var elements = dom$('<p class="text">This is more text</p><p>Even more!</p>');
elements.each(document.body.appendChild.bind(document.body));
new Stream(text.getElements())
.filter(function (elem) { return elem.innerHTML.indexOf('text') > 0 })
.forEach(console.log.bind(console));
dom$(elements) => dom$
Creates a new dom$.
dom$.prototype.each(function(element:Element)) => dom$
Iterates through all of the elements and returns instance of self.
dom$.prototype.empty() => dom$
Removes all child nodes and returns instance of self.
dom$.prototype.remove() => dom$
Removes all nodes and returns instance of self.
dom$.prototype.getElements() => Element[]
Returns all elements as an array.
FAQs
< 1KB library for DOM selections in JavaScript
We found that dom-dollar 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.