{"id":20819962,"url":"https://github.com/elo7/events-amd","last_synced_at":"2025-07-09T06:03:53.400Z","repository":{"id":29949216,"uuid":"33495757","full_name":"elo7/events-amd","owner":"elo7","description":"Event.js is a tiny library to add and remove events in any browser.","archived":false,"fork":false,"pushed_at":"2021-04-28T22:19:34.000Z","size":25,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":100,"default_branch":"master","last_synced_at":"2025-07-09T06:01:54.474Z","etag":null,"topics":["amd","events","front-end","javascript","lib","martell","nymeros"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elo7.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":"2015-04-06T17:43:03.000Z","updated_at":"2020-07-02T21:30:18.000Z","dependencies_parsed_at":"2022-08-26T15:01:13.599Z","dependency_job_id":null,"html_url":"https://github.com/elo7/events-amd","commit_stats":null,"previous_names":["elo7/event-amd"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/elo7/events-amd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2Fevents-amd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2Fevents-amd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2Fevents-amd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2Fevents-amd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elo7","download_url":"https://codeload.github.com/elo7/events-amd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2Fevents-amd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264403666,"owners_count":23602616,"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":["amd","events","front-end","javascript","lib","martell","nymeros"],"created_at":"2024-11-17T22:07:56.224Z","updated_at":"2025-07-09T06:03:53.358Z","avatar_url":"https://github.com/elo7.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Event-amd\n\n_Event-amd add/remove event library_\n\nEvent.js is a tiny library to add and remove events in any browser. This library uses [amd](http://en.wikipedia.org/wiki/Asynchronous_module_definition) structure.\n\n## Install\n\nInstall : `npm install elo7-events-amd`\n\n## Dependency\n\nEvent-amd depends on an [amd](http://en.wikipedia.org/wiki/Asynchronous_module_definition) implementation. We suggest [define-async](https://www.npmjs.com/package/define-async) implementation for dependency lookup.\n\n## Parameters\n\n#### element: DocumentElement\nEx.: document.querySelector('#link')\n\n\n#### event: String\nEvent that will be added or removed from the _element_\n\nEx.: 'click'\n\n\n#### callback: Function\nFunction that will be called when the _event_ is triggered, only for _addEvent_\n\nEx.: function(){ ... }\n\n\n#### configs: Object (optional) or String (optional)\nYou can pass a config with the following parameters:\n\n- named: like eventCategory\n\tYou can add multiple '_events_' of the same type (e.g: _click_) and use the _eventCategory_ parameter to remove certain events when needed.\n\n\tEx.:\n\t\tevent.addEvent(element, 'click', callback, { named: 'tracking' });\n\n- passive: Boolean (optional)\n\tIf _true_, indicates that the function specified by listener will never call preventDefault().\n\tOnly works on `addEvent`\n\n\tEx.:\n\t\tevent.addEvent(element, 'click', callback, { passive: true });\n\nEx.:\n\tevent.addEvent(element, 'click', callback, { named: 'tracking', passive: true });\n\n\nOr you can use the shorthand and only pass the eventCategory as parameter.\n\n\tEx.:\n\n\t\tevent.addEvent(element, 'click', callback, 'tracking');\n\t\tevent.addEvent(element, 'click', callback, 'action');\n\t\tevent.removeEvent(element, 'click', 'action');\n\n* `removeEvent` only supports Strings as last parameter\n\n## Example\n\n``` js\ndefine(['event'], function(event) {\n\tevent.addEvent(element, event, callback, eventCategory);\n\tevent.removeEvent(element, event, eventCategory);\n});\n```\n\n## License\n\nEvent-amd is released under the [BSD](https://github.com/elo7/event-amd/blob/master/LICENSE). Have at it.\n\n* * *\n\nCopyright :copyright: 2019 Elo7# event-amd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felo7%2Fevents-amd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felo7%2Fevents-amd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felo7%2Fevents-amd/lists"}