Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
dom events with a node-style EventEmitter api
var ever = require('ever');
var box = document.querySelector('#box');
var state = false;
ever(box).on('click', function (ev) {
ev.stopPropagation();
state = !state;
box.style['background-color'] = state ? 'red' : 'rgb(127,127,127)';
});
setInterval(function () {
ever(box).emit('click');
}, 3000);
var ever = require('ever')
Return a new
EventEmitter
that wraps the HTML node element
.
All the usual EventEmitter methods should work with the caveat that adding and removing listeners are proxied through to the underlying dom methods, which only expect a single event object as a parameter.
Emit an event name
with options opts
. This method creates a synthetic event
using document.createEvent()
and the corresponding variant of .initEvent()
that works with the event name
provided.
The options opts
will be passed into the matching .initEvent()
function
signature. Any additional properties will be added to the event object as
properties being calling .dispatchEvent()
.
The signatures are documented in the file init.json
in this distribution.
To see which event name maps to which init signature, see the types.json
file.
Just like node's EventEmitter.prototype.on()
, listen for events.
Internally this calls .addEventListener()
.
Just like node's EventEmitter.prototype.removeListener()
, remove a listener.
Internally this calls .removeEventListener()
, however there is no way to
obtain a list of all listeners from dom nodes, so only listeners registered by
the current ever()
instance can be removed.
Just like node EventEmitter.prototype.removeAllListeners()
, remove all the
listeners with name
or everything is name
is falsy.
Unlike in node, this function calls removeListener()
on each of the events to
remove them so that the underlying .removeEventListener()
calls get fired.
With npm do:
npm install ever
This module is meant for use in browsers with a node-style module system. Use browserify or similar.
MIT
FAQs
dom events with a node-style EventEmitter api
The npm package ever receives a total of 604 weekly downloads. As such, ever popularity was classified as not popular.
We found that ever 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.