
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Observe selectors in DOM.
spect( container=document, selector, handler? )Observes selector in container, invokes handler any time matching elements appear or disappear.
Handler can return a teardown function, called for unmatched elements.
Returns live collection of elements.
import spect from 'spect';
// assign aspect
const foos = spect('.foo', el => {
console.log('connected');
return () => console.log('disconnected');
});
// modify DOM
const foo = document.createElement('div');
foo.className = 'foo';
document.body.append(foo);
// ... "connected"
foo.remove();
// ... "disconnected"
spect(element[s], handler)Listens for connected/disconnected events for the list of elements. (alternative to fast-on-load)
let nodes = [...document.querySelectorAll('.foo'), document.createElement('div')];
// assign listener
spect(nodes, el => {
console.log("connected");
return () => console.log("disconnected");
});
// modify DOM
document.body.appendChild(nodes.at(-1))
// ... "connected"
nodes.at(-1).remove()
// ... "disconnected"
spect`selector`Creates live collection of elements matching the selector. Collection extends Array and implements Set / HTMLColection interfaces.
const foos = spect`.foo`;
// live collection
foos[idx], foos.at(idx) // Array
foos.has(el), foos.add(el), foos.delete(el) // Set
foos.item(idx), foos.namedItem(elementId) // HTMLCollection
foos.dispose() // destroy selector observer / unsubscribe
It combines selector parts indexing from selector-observer for simple queries and animation events from insertionQuery for complex selectors.
Simple selector is id/name/class/tag followed by classes or attrs.
#a, .x.y, [name="e"].x, *, a-b-c:x - simple selectors.a b, #b .c - complex selectors.insertionQuery, selector-observer, qso, qsa-observer, element-observer, livequery, selector-listener, mutation-summary, fast-on-load, selector-set, rkusa/selector-observer.
ॐ
FAQs
Observe selectors in DOM
We found that spect 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.