Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
jquery-once
Advanced tools
Filters out all elements that had the same filter applied on them before. It can be used to ensure that a function is only applied once to an element.
$('div.calendar').once('calendar', function() {
// This function is only executed once for each div, even if this
// code segment is executed repeatedly.
});
$('div.calendar').once('calendar').click(function() {
// .once('calendar') filters out all elements which already have been
// filtered with once(), and the elements that haven't been filtered
// yet remain. The previous set of elements can be restored with
// .end().
});
It also works without supplying a name:
$('div.calendar').once(function() {
// This function is only executed once for each div, even if this
// code segment is executed repeatedly. Other scripts can't refer
// to this `once` method. The once data used to store execution are
// in the form "jquery-once-1", "jquery-once-2", etc.
});
Leverage npm, grunt, and qunit:
$ npm install
$ npm test
$ grunt release
Dual licensed under the MIT and GPL licenses.
FAQs
Act on jQuery elements only once.
The npm package jquery-once receives a total of 4,460 weekly downloads. As such, jquery-once popularity was classified as popular.
We found that jquery-once 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.