Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
npm install evie
{Evie} = require "evie"
events = new Evie()
{evie} = require "evie"
class MyEvents extends EventEmitter
evie(@)
events = new MyEvents()
Evie (and any class that has been evied) provides several useful methods, many of which rely on following a convention for the names of emitted events. For error conditions, emit an event named "error". For successes, emit "success".
events = new Evie()
if everything_wrong?
events.emit "error", new Error "It is all wrong"
else
events.emit "success", {everything: "ok"}
Other event names are certainly legal, but they are not used by the
serially
, concurrently
, and wrap
methods.
forward
and source
The forward
method relays all events from one instance to another. source
creates a new instance and forwards all events from it to the caller. This
allows events to bubble up through a tree, which can be useful in observing
and handling errors at a single place in your system.
base = new Evie()
base.on "error", (error) -> console.error "We have a problem:", error
stuff = ->
base.source (events) ->
number = Date.now()
if number % 7 == 0
events.emit "error", new Error "Oh no, the time is divisible by seven!"
else
events.emit "success", number
e1 = stuff()
e1.on "success", (result) ->
console.log "The time is #{result} and it is NOT divisible by 7"
e2 = stuff()
e2.on "success", (result) ->
console.log "The time is STILL not divisible by 7."
wrap
serially
concurrently
FAQs
EventEmitter-style events with event-bubbling
The npm package evie receives a total of 4 weekly downloads. As such, evie popularity was classified as not popular.
We found that evie demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.