{"id":28102331,"url":"https://github.com/mango/emitter","last_synced_at":"2025-10-28T17:19:29.469Z","repository":{"id":28898514,"uuid":"32423277","full_name":"Mango/emitter","owner":"Mango","description":"A JavaScript event emitter written in ES6.","archived":false,"fork":false,"pushed_at":"2015-05-04T18:17:02.000Z","size":260,"stargazers_count":25,"open_issues_count":1,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-17T23:41:02.190Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mango.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-17T22:11:57.000Z","updated_at":"2022-06-24T06:04:07.000Z","dependencies_parsed_at":"2022-08-02T20:00:26.562Z","dependency_job_id":null,"html_url":"https://github.com/Mango/emitter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Mango/emitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mango%2Femitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mango%2Femitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mango%2Femitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mango%2Femitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mango","download_url":"https://codeload.github.com/Mango/emitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mango%2Femitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268248481,"owners_count":24219554,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-05-13T19:50:54.273Z","updated_at":"2025-10-28T17:19:24.429Z","avatar_url":"https://github.com/Mango.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# emitter\n\n\u003e A JavaScript Emitter written in ES6.\n\n## Usage\n```js\nimport Emitter from 'emitter';\n\nconst bus = new Emitter();\n\nbus.emit('finish');\n```\n\n## API\n\n### Emitter#on(event, listener)\nAdds a `listener` to the collection for a specified `event`.\n- `event` - The name of the event you want to add.\n- `listener` - Listener you want to add from given event.\n\n```js\nemitter.on('live', listener);\n```\n\n### Emitter#once(event, listener)\nAdds a one time `listener` to the collection for a specified `event`. It will execute only once.\n- `event` - The name of the event.\n- `listener` - Listener you want to add from the given event.\n\n```js\nemitter.once('live', listener);\n```\n\n### Emitter#off(event, listener)\nRemoves a `listener` from the collection for a specified `event`.\n- `event` - The name of the event.\n- `listener` - Listener you want to remove from the given event.\n\n```js\nemitter.off('live', listener);\n```\n\n### Emitter#emit(event, [...args])\nExecute each of the `listeners` collection in order with the given parameters.\n- `event` - The name of the event you want to emit.\n- `[...args]` - The given arguments.\n\n```js\nemitter.emit('live', 'data1', 'data2');\n```\n\n## npm-scripts\n```\n$ npm run compile\n```\n\n```\n$ npm run browser\n```\n\n```\n$ npm test\n```\n\n```\n$ npm run hint\n```\n\n## License\nMIT license. Copyright © 2015 [Mango](http://getmango.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmango%2Femitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmango%2Femitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmango%2Femitter/lists"}