Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nanoevents

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanoevents - npm Package Compare versions

Comparing version 8.0.0 to 9.0.0

11

index.js
export let createNanoEvents = () => ({
emit(event, ...args) {
let callbacks = this.events[event] || []
for (let i = 0, length = callbacks.length; i < length; i++) {
for (
let i = 0,
callbacks = this.events[event] || [],
length = callbacks.length;
i < length;
i++
) {
callbacks[i](...args)

@@ -10,3 +15,3 @@ }

on(event, cb) {
this.events[event]?.push(cb) || (this.events[event] = [cb])
;(this.events[event] ||= []).push(cb)
return () => {

@@ -13,0 +18,0 @@ this.events[event] = this.events[event]?.filter(i => cb !== i)

{
"name": "nanoevents",
"version": "8.0.0",
"description": "Simple and tiny (130 bytes) event emitter library",
"version": "9.0.0",
"description": "Simple and tiny (107 bytes) event emitter library",
"keywords": [

@@ -20,3 +20,3 @@ "EventEmitter",

"engines": {
"node": "^16.0.0 || ^18.0.0 || >=20.0.0"
"node": "^18.0.0 || >=20.0.0"
},

@@ -23,0 +23,0 @@ "sideEffects": false,

@@ -5,3 +5,3 @@ # Nano Events

* Only **130 bytes** (minified and gzipped).
* Only **107 bytes** (minified and brotlied).
It uses [Size Limit] to control size.

@@ -8,0 +8,0 @@ * The `on` method returns `unbind` function. You don’t need to save

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc