
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.
lazytrigger
Advanced tools
Notify when certain points of the DOM enter / leave the view using on-intersect.
npm i --save lazytrigger
var html = require('nanohtml')
var LazyTrigger = require('lazytrigger')
var trigger = new LazyTrigger(onEnter, onLeave)
module.exports = () => {
return html`
<div style="font-size: 5rem;">
<div style="height: 200vh">Scroll down, check the console...</div>
${trigger.breakpoint('first')}
<div style="height: 200vh">Even more...</div>
${trigger.breakpoint('second')}
</div>
`
}
function onEnter (id) {
console.log(id + ' entered')
}
function onLeave (id) {
console.log(id + ' left')
}
Put it to the bottom of an endless scrolling list, play sounds, change the background image, autoplay videos, you name it.
trigger = new LazyTrigger(onEnter(id), onLeave(id))Initialize a new handler. onEnter is called when a breakpoint enters the view, onLeave is called when a breakpoint leaves the view; both get the id of the breakpoint.
trigger.breakpoint(id)Returns an empty element that will be observed. It has a comment inside (<!-- lazytrigger {id} -->) in order to be easily identifiable.
trigger.stop(id)Stop observing a specific breakpoint.
trigger.stopAll()Stop observing all the breakpoints.
FAQs
Notify when certain points of the DOM enter / leave the view
We found that lazytrigger 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.