{"id":21420555,"url":"https://github.com/maxhoffmann/emitter","last_synced_at":"2025-03-16T20:11:32.329Z","repository":{"id":18124381,"uuid":"21202337","full_name":"maxhoffmann/emitter","owner":"maxhoffmann","description":"Event emitter implementation using the “frozen closure” pattern as described by Douglas Crockford.","archived":false,"fork":false,"pushed_at":"2020-06-19T14:00:06.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T21:16:14.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/maxhoffmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-25T12:26:46.000Z","updated_at":"2020-06-19T14:00:09.000Z","dependencies_parsed_at":"2022-09-09T20:11:52.346Z","dependency_job_id":null,"html_url":"https://github.com/maxhoffmann/emitter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxhoffmann%2Femitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxhoffmann%2Femitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxhoffmann%2Femitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxhoffmann%2Femitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxhoffmann","download_url":"https://codeload.github.com/maxhoffmann/emitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243926066,"owners_count":20369910,"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":[],"created_at":"2024-11-22T20:18:11.904Z","updated_at":"2025-03-16T20:11:32.301Z","avatar_url":"https://github.com/maxhoffmann.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Emitter [![npm version][1]][2]\n=======\n\nEvent emitter implementation using the “frozen closure” pattern as [described by Douglas Crockford](http://www.ustream.tv/recorded/46640057). Heavily inspired by [component/emitter](https://github.com/component/emitter).\n\nBrowser support: ES5 compatible browsers (IE9+)\n\nInstallation\n------------\n\n```bash\nnpm install maxhoffmann-emitter --save\n```\n\nUsage\n-----\n\n```js\nvar Emitter = require('maxhoffmann-emitter');\n\nvar emitter = Emitter();\n\nemitter.on('eventName', listener);\nemitter.once('eventName', listener); // only listen once\n\nemitter.off('eventName', listener); // remove specific listener\nemitter.off('eventName'); // remove all listeners of this event\nemitter.off(); // remove all listeners\n\nemitter.trigger('eventName', arg1, arg2…); // arguments are optional\n\nemitter.hasListeners('eventName');\nemitter.hasListeners(); // returns true if any listeners are added\n```\n\n__Note:__ This library is built with webpack to the UMD format. You can therefore use it with common.js and amd loaders or as a global variable.\n\n\nTesting\n-------\n\n- `cd` into directory\n- run `npm test`\n\n\nDevelopment\n-----------\n\n`npm run build` to create a minimized and UMD format compatible version of the source file.\n\n\nLICENSE\n-------\n\nThe MIT License\n\n  [1]: http://img.shields.io/npm/v/maxhoffmann-emitter.svg?style=flat\n  [2]: https://www.npmjs.org/package/maxhoffmann-emitter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxhoffmann%2Femitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxhoffmann%2Femitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxhoffmann%2Femitter/lists"}