
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
DOM-Event-Manager, leveraging the powers of object-getters & the Proxy-object
Ammer is a proof of concept, building a DOM-event-wrapper with the powers of object-getters and the Proxy
-object.
Therefore it does only work in Firefox and Microsoft Edge. Please don't use it in production!
The idea is to specify the event by calling a method, instead of passing the name as a string to a function.
$ npm install --save ammer
First you have to import the ammer
-object.
// ES2015 modules
import { ammer } from 'ammer';
// CommonJS modules
var ammer = require('ammer');
// AMD
require(['ammer'], function (ammer) { ... });
// Global variable
var ammer = window.ammer;
Then you have to create an instance. After that you can start binding and unbinding DOM-events.
var amr = ammer.create();
// Binding a click-event
amr.on.click(document.body, function () {
console.log('Clicked the body.');
});
// Unbinding all click-events
amr.off.click(document.body);
You can optionally pass the callback-function to the off
-method, as well, to not remove all bindings for an event-type.
var amr = ammer.create();
function onMouseEnter() {
console.log('Mouse did enter ...');
}
// Bind to `mouseenter` ...
amr.on.mouseenter(document.querySelector('#hover-me'), onMouseEnter);
// ... and unbind again.
amr.off.mouseenter(document.querySelector('#hover-me'), onMouseEnter);
All other mouseenter
-bindings to this element aren't affected.
The on
- and off
-methods of the ammer
-object set the current mode (addListener
or removeListener
) and return a Proxy
-instance, that handles all the get
-calls. Thus it's possible to call all the event-name-methods, though they aren't explicitly defined.
Beerware
FAQs
DOM-Event-Manager, leveraging the powers of object-getters & the Proxy-object
The npm package ammer receives a total of 7 weekly downloads. As such, ammer popularity was classified as not popular.
We found that ammer 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
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.