{"id":24866082,"url":"https://github.com/sahneedev/eventemitter","last_synced_at":"2025-06-15T19:06:59.669Z","repository":{"id":39756304,"uuid":"204355363","full_name":"SahneeDEV/eventemitter","owner":"SahneeDEV","description":"An event emitter for our projects. Based on eventemitter3 and enhanced-event-emitter","archived":false,"fork":false,"pushed_at":"2023-04-17T14:14:11.000Z","size":233,"stargazers_count":0,"open_issues_count":12,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T22:42:41.360Z","etag":null,"topics":["eventemitter","events","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@sahnee/eventemitter","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SahneeDEV.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-08-25T22:10:47.000Z","updated_at":"2022-05-05T21:25:37.000Z","dependencies_parsed_at":"2023-07-18T16:21:38.975Z","dependency_job_id":null,"html_url":"https://github.com/SahneeDEV/eventemitter","commit_stats":null,"previous_names":["sahnee-de/eventemitter"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/SahneeDEV/eventemitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SahneeDEV%2Feventemitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SahneeDEV%2Feventemitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SahneeDEV%2Feventemitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SahneeDEV%2Feventemitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SahneeDEV","download_url":"https://codeload.github.com/SahneeDEV/eventemitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SahneeDEV%2Feventemitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260035280,"owners_count":22949248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eventemitter","events","javascript","typescript"],"created_at":"2025-02-01T00:47:03.829Z","updated_at":"2025-06-15T19:06:59.630Z","avatar_url":"https://github.com/SahneeDEV.png","language":"JavaScript","readme":"# @sahnee/eventemitter\n\nYet another EventEmitter\n\n## Features\n\n* Classic subscription based event emitter class\n* Observer pattern\n* Written in TypeScript\n* Fully unit tested\n\n## EventEmitter\n\nThe `EventEmitter` is the main usage of this library. You can either use it as a standalone class instance of inherit your own classes form it.\n\nIt features all basic functions of an event emitter:\n\n```js\nimport EventEmitter from '@sahnee/eventemitter';\n\nconst ee = new EventEmitter();\nee.on('my-event', args =\u003e console.log('Event:', args));\nee.emit('my-event', 1);\nee.emit('my-event', 2);\n// Prints:\n// - Event: 1\n// - Event: 2\n```\n\nAll supported functions and properties are. Parameters marked with `?` are optional:\n\n* `prefix` - A prefix used for non symbol events to avoid e.g. prototype pollution. By default `'~'`.\n* `eventNames()` - The names of all currently registered events.\n* `listeners(event)` - Gets all listeners of the given event.\n* `listenerCount(event)` - Gets amount of listeners for the given event.\n* `emit(event, ...args)` - Emits the given event and invokes all handlers for it.\n* `addEventListener(event, fn, context?, once?, priority?)` - Adds an event listener to the given event. Options are:\n  * `context` - What `this` will refer to in your callback.\n  * `once` - If this is true the event handler will once be invoked once.\n  * `priority` - The priority of the event handler. See the numeric `Priority` enum for recommended base values.\n* `on(event, fn, context?, priority?)` - Alias for `addEventListener(event, fn, false, context, priority)`.\n* `once(event, fn, context?, priority?)` - Alias for `addEventListener(event, fn, true, context, priority)`.\n* `removeListener(event, fn?: ListenerFn, context?, once?, priority?)` - Removes a event handler again.\n* `off(event, fn?: ListenerFn, context?, once?, priority?)` - Alias for `removeListener` with the same parameters.\n* `removeAllListeners(event?)` - Removes either all listeners of the entire emitter or just for the given event.\n\n## Observer\n\nThe observer pattern is currently not part of the stable public API. Usage is therefore discouraged.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahneedev%2Feventemitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsahneedev%2Feventemitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahneedev%2Feventemitter/lists"}