{"id":22944492,"url":"https://github.com/pinkhominid/network-event","last_synced_at":"2025-07-31T06:35:12.550Z","repository":{"id":65456980,"uuid":"236213656","full_name":"pinkhominid/network-event","owner":"pinkhominid","description":"A global normalized event for browser network requests (fetch \u0026 XHR).","archived":false,"fork":false,"pushed_at":"2021-02-04T03:22:47.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T19:01:21.838Z","etag":null,"topics":["browser","event","network","request"],"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/pinkhominid.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":"2020-01-25T18:45:53.000Z","updated_at":"2023-03-04T05:37:39.000Z","dependencies_parsed_at":"2023-01-24T11:55:12.148Z","dependency_job_id":null,"html_url":"https://github.com/pinkhominid/network-event","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pinkhominid/network-event","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinkhominid%2Fnetwork-event","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinkhominid%2Fnetwork-event/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinkhominid%2Fnetwork-event/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinkhominid%2Fnetwork-event/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pinkhominid","download_url":"https://codeload.github.com/pinkhominid/network-event/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinkhominid%2Fnetwork-event/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267998897,"owners_count":24178652,"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-07-31T02:00:08.723Z","response_time":66,"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":["browser","event","network","request"],"created_at":"2024-12-14T14:18:53.823Z","updated_at":"2025-07-31T06:35:12.504Z","avatar_url":"https://github.com/pinkhominid.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Network Event\n\nA global normalized event for browser network requests (fetch \u0026 XHR).\n\n```sh\nnpm i network-event\n```\n\n```js\nimport { NETWORK_EVENT, PENDING_STATE, COMPLETE_STATE } from 'network-event';\n\nwindow.addEventListener(NETWORK_EVENT, async e =\u003e {\n  switch (e.detail.state) {\n    case PENDING_STATE: console.log(e.detail); break;\n    case COMPLETE_STATE: console.log(e.detail, await e.detail.json()); break;\n  }\n});\n\nfetch('https://jsonplaceholder.typicode.com/users');\n\nconst req = new XMLHttpRequest();\nreq.open('get', 'https://jsonplaceholder.typicode.com/users');\nreq.send();\n```\n\n```sh\n▸ Object { state: \"pending\", url: \"https://jsonplaceholder.typicode.com/users\" }\n\n▸ Object { state: \"pending\", url: \"https://jsonplaceholder.typicode.com/users\" }\n\n▸ Object { state: \"complete\", url: \"https://jsonplaceholder.typicode.com/users\", status: 200, \"content-type\": \"application/json; charset=utf-8\", text: send(), json: send() }\n▸ Array(10) [ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…} ]\n\n▸ Object { state: \"complete\", url: \"https://jsonplaceholder.typicode.com/users\", status: 200, \"content-type\": \"application/json; charset=utf-8\", text: fetch(), json: fetch() }\n▸ Array(10) [ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…} ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinkhominid%2Fnetwork-event","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinkhominid%2Fnetwork-event","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinkhominid%2Fnetwork-event/lists"}