{"id":13526787,"url":"https://github.com/scottcorgan/tiny-emitter","last_synced_at":"2025-04-11T03:28:07.347Z","repository":{"id":12943553,"uuid":"15621513","full_name":"scottcorgan/tiny-emitter","owner":"scottcorgan","description":"A tiny (less than 1k) event emitter library","archived":false,"fork":false,"pushed_at":"2021-08-11T00:53:02.000Z","size":93,"stargazers_count":951,"open_issues_count":9,"forks_count":70,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-03T18:09:47.064Z","etag":null,"topics":["event-emitter","tiny"],"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/scottcorgan.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-01-03T22:42:04.000Z","updated_at":"2025-04-02T09:56:48.000Z","dependencies_parsed_at":"2022-07-11T22:31:24.132Z","dependency_job_id":null,"html_url":"https://github.com/scottcorgan/tiny-emitter","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottcorgan%2Ftiny-emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottcorgan%2Ftiny-emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottcorgan%2Ftiny-emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottcorgan%2Ftiny-emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottcorgan","download_url":"https://codeload.github.com/scottcorgan/tiny-emitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248335067,"owners_count":21086507,"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":["event-emitter","tiny"],"created_at":"2024-08-01T06:01:34.901Z","updated_at":"2025-04-11T03:28:07.326Z","avatar_url":"https://github.com/scottcorgan.png","language":"JavaScript","readme":"# tiny-emitter\n\nA tiny (less than 1k) event emitter library.\n\n## Install\n\n### npm\n\n```\nnpm install tiny-emitter --save\n```\n\n## Usage\n\n```js\nvar Emitter = require('tiny-emitter');\nvar emitter = new Emitter();\n\nemitter.on('some-event', function (arg1, arg2, arg3) {\n //\n});\n\nemitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value');\n```\n\nAlternatively, you can skip the initialization step by requiring `tiny-emitter/instance` instead. This pulls in an already initialized emitter.\n\n```js\nvar emitter = require('tiny-emitter/instance');\n\nemitter.on('some-event', function (arg1, arg2, arg3) {\n //\n});\n\nemitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value');\n```\n\n## Instance Methods\n\n### on(event, callback[, context])\n\nSubscribe to an event\n\n* `event` - the name of the event to subscribe to\n* `callback` - the function to call when event is emitted\n* `context` - (OPTIONAL) - the context to bind the event callback to\n\n### once(event, callback[, context])\n\nSubscribe to an event only **once**\n\n* `event` - the name of the event to subscribe to\n* `callback` - the function to call when event is emitted\n* `context` - (OPTIONAL) - the context to bind the event callback to\n\n### off(event[, callback])\n\nUnsubscribe from an event or all events. If no callback is provided, it unsubscribes you from all events.\n\n* `event` - the name of the event to unsubscribe from\n* `callback` - the function used when binding to the event\n\n### emit(event[, arguments...])\n\nTrigger a named event\n\n* `event` - the event name to emit\n* `arguments...` - any number of arguments to pass to the event subscribers\n\n## Test and Build\n\nBuild (Tests, Browserifies, and minifies)\n\n```\nnpm install\nnpm run build\n```\n\nTest\n\n```\nnpm install\nnpm test\n```\n\n## License\n\n[MIT](https://github.com/scottcorgan/tiny-emitter/blob/master/LICENSE)\n","funding_links":[],"categories":["Repository","JavaScript"],"sub_categories":["Event"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottcorgan%2Ftiny-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottcorgan%2Ftiny-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottcorgan%2Ftiny-emitter/lists"}