{"id":16625695,"url":"https://github.com/aleclarson/lua-emitter","last_synced_at":"2025-08-02T07:18:12.605Z","repository":{"id":66177837,"uuid":"127487682","full_name":"aleclarson/lua-emitter","owner":"aleclarson","description":"Event emitters for Lua","archived":false,"fork":false,"pushed_at":"2018-12-05T16:59:07.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T12:33:50.319Z","etag":null,"topics":["emitter","eventemitter","lua"],"latest_commit_sha":null,"homepage":null,"language":"MoonScript","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/aleclarson.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-31T01:20:12.000Z","updated_at":"2019-01-07T16:55:27.000Z","dependencies_parsed_at":"2023-02-20T17:15:39.175Z","dependency_job_id":null,"html_url":"https://github.com/aleclarson/lua-emitter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/aleclarson/lua-emitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Flua-emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Flua-emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Flua-emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Flua-emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleclarson","download_url":"https://codeload.github.com/aleclarson/lua-emitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Flua-emitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268348591,"owners_count":24236297,"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-02T02:00:12.353Z","response_time":74,"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":["emitter","eventemitter","lua"],"created_at":"2024-10-12T04:06:50.365Z","updated_at":"2025-08-02T07:18:12.597Z","avatar_url":"https://github.com/aleclarson.png","language":"MoonScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lua-emitter v0.0.3\n\nEvent emitters for Lua.\n\n```lua\nlocal Emitter = require('emitter')\n\nlocal emitter = Emitter()\n\n-- Arguments are variadic\nfunction listener(a, b, c)\n  print('a =', a)\n  print('b =', b)\n  print('c =', c)\nend\n\n-- Listen forever\nemitter:on('foo', listener)\n\n-- Broadcast an event\nemitter:emit('foo', 1, 2, 3)\n\n-- Listen for the next event only\nemitter:once('foo', function()\n  print('just once!')\nend)\n\nemitter:len('foo') -- 2\nemitter:emit('foo')\nemitter:len('foo') -- 1\n\n-- Remove a listener (added via on or once)\nemitter:off('foo', listener)\n\n-- Remove all listeners\nemitter:off('foo')\n\n-- The event-\u003elisteners table\nemitter.events\n\n-- Set an event fallback for all emitters.\nEmitter.setFallback('error', function(err, errno)\n  print('unhandled error:', err, errno)\nend)\n\n-- Set an event fallback for one emitter.\nemitter:on('error', function(err, errno)\n  if emitter:len('error') == 1 then\n    print('unhandled error:', err, errno)\n  end\nend)\n```\n\nListeners are called in order of `on/once` calls.\n\nBy default, unhandled `error` and `warn` events are printed to console.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Flua-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleclarson%2Flua-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Flua-emitter/lists"}