Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Tiny event helping JavaScript library.
Fires event with given name
, given scope and other parameters.
.
) or slash (/
) separatedReturns: object array of returned values from the listeners. Array has two methods .firstDefined()
and .lastDefined()
to get first or last not undefined
value.
Internal method which gives you array of all event handlers that will be triggered by the given name
.
.
) or slash (/
) separatedReturns: array array of event handlers
If for some reasons you don’t like default separators (.
or /
) you can specify yours
here. Be aware that if you pass a string longer than one character it will be treated as
a list of characters.
.
or /
.Binds given event handler with a given name. You can use wildcards “*
” for the names:
eve.on("*.under.*", f);
eve("mouse.under.floor"); // triggers f
Use eve to trigger the listener.
.
) or slash (/
) separated, with optional wildcardsReturns: function returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.
eve.on("mouse", eatIt)(2);
eve.on("mouse", scream);
eve.on("mouse", catchIt)(1);
This will ensure that catchIt
function will be called before eatIt
.
If you want to put your handler before non-indexed handlers, specify a negative value. Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.
Returns function that will fire given event with optional arguments. Arguments that will be passed to the result function will be also concated to the list of final arguments.
el.onclick = eve.f("click", 1, 2);
eve.on("click", function (a, b, c) {
console.log(a, b, c); // 1, 2, [event object]
});
Returns: function possible event handler function
Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.
Could be used inside event handler to figure out actual name of the event.
Returns: string name of the event, if subname
is not specified
or
Returns: boolean true
, if current event’s name contains subname
Could be used inside event handler to figure out actual name of the event.
Returns: array names of the event
Removes given function from the list of event listeners assigned to given name. If no arguments specified all the events will be cleared.
.
) or slash (/
) separated, with optional wildcardsSee eve.off
Binds given event handler with a given name to only run once then unbind itself.
eve.once("login", f);
eve("login"); // triggers f
eve("login"); // no listeners
Use eve to trigger the listener.
.
) or slash (/
) separated, with optional wildcardsReturns: function same return function as eve.on
Current version of the library.
FAQs
Simple custom events
The npm package eve receives a total of 32,454 weekly downloads. As such, eve popularity was classified as popular.
We found that eve 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.