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 6.0.2 to 7.0.0

7

index.js
export let createNanoEvents = () => ({
events: {},
emit(event, ...args) {
;(this.events[event] || []).forEach(i => i(...args))
for (let i = 0, handlers = this.events[event] || [], length = handlers.length; i < length; i++) handlers[i](...args)
},
on(event, cb) {
;(this.events[event] = this.events[event] || []).push(cb)
return () =>
(this.events[event] = (this.events[event] || []).filter(i => i !== cb))
this.events[event]?.push(cb) || (this.events[event] = [cb])
return () => (this.events[event] = this.events[event]?.filter(i => cb !== i))
}
})
{
"name": "nanoevents",
"version": "6.0.2",
"description": "Simple and tiny (72 bytes) event emitter library",
"version": "7.0.0",
"description": "Simple and tiny (99 bytes) event emitter library",
"keywords": [

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

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

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

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

* Only **97 bytes** (minified and gzipped).
* Only **99 bytes** (minified and gzipped).
It uses [Size Limit] to control size.

@@ -8,0 +8,0 @@ * `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