
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
< 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
The npm package dom-dollar receives a total of 3 weekly downloads. As such, dom-dollar popularity was classified as not popular.
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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.