{"id":22095994,"url":"https://github.com/perimeterx/map-events","last_synced_at":"2025-07-01T10:35:00.845Z","repository":{"id":56548913,"uuid":"200680946","full_name":"PerimeterX/map-events","owner":"PerimeterX","description":"events mapped out completely cross browsers","archived":false,"fork":false,"pushed_at":"2021-08-10T16:48:26.000Z","size":5,"stargazers_count":20,"open_issues_count":2,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-27T01:40:45.160Z","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/PerimeterX.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":"2019-08-05T15:21:57.000Z","updated_at":"2023-09-22T04:17:48.000Z","dependencies_parsed_at":"2022-08-15T20:40:53.868Z","dependency_job_id":null,"html_url":"https://github.com/PerimeterX/map-events","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PerimeterX/map-events","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerimeterX%2Fmap-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerimeterX%2Fmap-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerimeterX%2Fmap-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerimeterX%2Fmap-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PerimeterX","download_url":"https://codeload.github.com/PerimeterX/map-events/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerimeterX%2Fmap-events/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262944650,"owners_count":23388799,"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-12-01T04:09:20.370Z","updated_at":"2025-07-01T10:35:00.825Z","avatar_url":"https://github.com/PerimeterX.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# map-events\n\nEvents mapped out [completely](https://perimeterx.github.io/map-events-website/) - cross browsers\n\nUsing this powerful little tool will map out for you all Events in any browser you'd wish to execute it on.\n\n## installation\n\n`npm install px-map-events --save`\n\n## usage\n\n```javascript\nconst getEventsMap = require('map-events');\n\nconst EventsMap = getEventsMap();\n```\n\n## output\n\na map of all events in the browser in the following format:\n\n```javascript\n{\n    'OBJECT': [\n        'EVENT1',\n        'EVENT2',\n        'EVENT3'\n    ]\n}\n```\n\n# example\n\n```javascript\nconst getEventsMap = require('map-events');\n\nconst webSocketEventsMap = getEventsMap('WebSocket');\n\n(webSocketEventsMap == {\n  \"WebSocket\": [\n    \"open\",\n    \"error\",\n    \"close\",\n    \"message\"\n  ] // results in true\n});\n```\n\nhere's an example of how to register with your own listener to every event that exists on `window`!\n\n```javascript\n\nconst windowEventsMap = getEventsMap('window')['window'];\n\nfor (let i = 0; i \u003c windowEventsMap.length; i++) {\n  const event = windowEventsMap[i];\n  window[event] = (event) =\u003e { console.log(event) });\n}\n```\n\n## options\n\n1. `filter` (first optional argument)\n\nallows you to pass a string that must exist within the object in order for it to make it to the final result map:\n\n```javascript\nconst getEventsMap = require('map-events');\n\nconst EventsMap = getEventsMap('*'); // will return a non-filtered map\nconst EventsMap = getEventsMap('HTML'); // will return a map that only contains objects that contain the string 'HTML' (such as 'HTMLBodyElement')\nconst EventsMap = getEventsMap('Doc'); // will return a map that only contains objects that contain the string 'Doc' (such as 'Document')\n```\n\ndefault value: `'*'`\n\n2. `hasOwnProperty` (second optional argument)\n\nallows you to pass a boolean that indicates whether iterated object must has iterated property as its own property or not:\n\n```javascript\nconst getEventsMap = require('map-events');\n\nconst EventsMap = getEventsMap('*', true); // will return a map with objects and  events properties that are the object's own properties\nconst EventsMap = getEventsMap('*', false); // will return a map with objects and  events properties - whether the properties are the object's own properties or not\n```\n\ndefault value: `true`\n\n3. `noEmptyArrays` (third optional argument)\n\nallows you to pass a boolean that indicates whether final result object should contain objects that have zero events or not:\n\n```javascript\nconst getEventsMap = require('map-events');\n\nconst EventsMap = getEventsMap('*', true, true); // will return a map with objects and events properties only if the object even has any events\nconst EventsMap = getEventsMap('*', true, false); // will return a map with objects and events properties whether the object has any events or not\n```\n\ndefault value: `false`\n\n4. `debug` (fourth optional argument)\n\nallows you to pass a boolean that indicates whether to run module in debug mode or not. debug mode just logs errors in case any are thrown:\n\n```javascript\nconst getEventsMap = require('map-events');\n\nconst EventsMap = getEventsMap('*', true, true, true); // will run in debug mode\nconst EventsMap = getEventsMap('*', true, false, false); // will not run in debug mode\n```\n\ndefault value: `false`\n\n## contribution\n\nin addition to this project there is a [website](https://perimeterx.github.io/map-events-website/) that\nshould show the events map of every (os + browser) combination that ever existed.\nin reality however, it shows most of the existing combinations, but not all of them.\nthe maps were extracted using every existing combination in [browserstack](https://browserstack.com), but even\nin browserstack many automatic combinations have failed.\nalso, the extraction script is not automatic and does not run every\ntime there's a new browser/os.\ncontributing to the [JSON](https://github.com/perimeterx/map-events-website/blob/master/data.json) could help a lot with maintaining the map and keeping it as updated and as accurate as possible.\nhighly appreciated!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperimeterx%2Fmap-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperimeterx%2Fmap-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperimeterx%2Fmap-events/lists"}