Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
A small Event Manager library written in ES6. It doesn't do anything more than what it's supposed to.
In the immortal words of XKCD:
Install with npm install evnt
and include it in your project. It works with
both Node and the browser. Use any one of the following styles, depending on
what you're doing:
// ES5 Style
var evnt = require('evnt').default
// ES6 Style
import evnt from 'evnt'
// As a script
<script src="path/to/scripts/evnt.js" />
You can then create as many instances of it as you please, each one is independent from the others:
let EventManager = new evnt()
Any time you want to register an event, you simply need to call the .on
method
on the evnt instance:
let sum = (a, b) => a + b
EventManager.on('my-event', sum)
If you grow tired of a single event handler, you can .off
it just as easily,
provided you have a reference to the original function:
EventManager.off('my-event', sum)
You can also unregister all event handlers from an event:
EventManager.off('my-event')
Any time you want to trigger an event, just .fire
it. You can, optionally,
pass some arguments along, they will be forwarded to your handlers. The result
of every event handler will be stored in an array, which will be returned by the
.fire
method. Handlers will be called in the order they were registered:
let sum = (a, b) => a + b
let multiply = (a, b) => a * b
EventManager.on('my-event', sum)
EventManager.on('my-event', multiply)
let results = EventManager.fire('my-event', 4, 5)
// => [9, 20]
Clone the repository, run npm install
, hack away and add your tests. Run
npm test
to check that everything is good, and then build with
npm run build-dist
. If you want a non minified bundled version with source
maps, run npm run build-dev
, it will be placed in the dev
directory.
Pull requests and issues are welcome!
MIT
FAQs
An Event Manager
We found that evnt 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.