Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
ampersand-dom
Advanced tools
Minimal util-layer for applying transformations to DOM.
Still in a very in-progress-not-sure-if-this-is-a-good-idea type stage.
Still needs tests
It's a pretty thin layer on top of DOM apis, but should work crossbrowser (needs tests still).
It has zero dependencies.
npm install ampersand-dom
Here are all the methods and their usage:
var dom = require('ampersand-dom');
// sets text content of element
dom.text(el, 'set text content');
// uses classList if available
dom.addClass(el, 'someclass');
dom.removeClass(el, 'someclass');
// removes old if found, adds new
dom.switchClass(el, 'oldclass', 'newclass');
// makes sure attribute (with no content) is added
// if exists it will be cleared of content
dom.addAttribute(el, 'checked');
// completely removes attribute
dom.removeAttribute(el, 'checked');
// sets attribute to string value given, clearing any current value
dom.setAttribute(el, 'value', 'the value');
// sets display none
dom.hide(el);
// shows element, trying to determine it's default display state
// based on tagname and getComputedStyle()
dom.show(el);
// sets inner HTML, takes string or DOM
dom.html(el, '<div></div>');
Initially created by @HenrikJoreteg with much inspiration/discussion with @philip_roberts.
MIT
FAQs
Super light-weight DOM manipulation lib.
The npm package ampersand-dom receives a total of 7,782 weekly downloads. As such, ampersand-dom popularity was classified as popular.
We found that ampersand-dom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.