{"id":50714955,"url":"https://github.com/eliasku/sockjs-client","last_synced_at":"2026-06-09T18:30:45.188Z","repository":{"id":359527190,"uuid":"1246475062","full_name":"eliasku/sockjs-client","owner":"eliasku","description":"A modern, browser-only SockJS client — rewritten in pure TypeScript ESM","archived":false,"fork":false,"pushed_at":"2026-05-22T09:32:54.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-22T15:49:26.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/eliasku.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-22T08:22:44.000Z","updated_at":"2026-05-22T09:32:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/eliasku/sockjs-client","commit_stats":null,"previous_names":["eliasku/sockjs-client"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/eliasku/sockjs-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasku%2Fsockjs-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasku%2Fsockjs-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasku%2Fsockjs-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasku%2Fsockjs-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliasku","download_url":"https://codeload.github.com/eliasku/sockjs-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasku%2Fsockjs-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34121020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":[],"created_at":"2026-06-09T18:30:44.478Z","updated_at":"2026-06-09T18:30:45.182Z","avatar_url":"https://github.com/eliasku.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sockts\n\nA modern, browser-only SockJS client — rewritten in pure TypeScript ESM.\n\nThis is a fork of [sockjs-client](https://github.com/sockjs/sockjs-client) stripped down to what matters in 2025: a clean ESM module with zero dependencies, no Node.js runtime support, no legacy browser workarounds, and no CommonJS artifacts.\n\n## Why\n\nThe original `sockjs-client` was designed around 2011-era constraints: IE6/7/8 support, Node.js `http` fallback transports, CommonJS `require()`, and the `debug` npm package for logging. Over a decade later, every one of those concerns is obsolete for modern applications. This library removes them all and ships a small, type-safe ESM module instead.\n\n### What changed\n\n**Format \u0026 language**\n\n- Pure TypeScript ESM — no `require()`, no `module.exports`, no CommonJS\n- `export class` / `export function` / `export const` throughout (no default exports)\n- Arrow functions instead of `const self = this` patterns\n- Template literals instead of string concatenation\n- `Date.now()` instead of `+new Date()`\n- `\"0\".repeat(n)` instead of `new Array(n).join(\"0\")`\n- Rest parameters instead of `arguments` object\n- `class extends` instead of the `inherits` npm package\n- Native `URL` constructor instead of `url-parse` npm package\n- Native `crypto.getRandomValues()` instead of Node.js `crypto.randomBytes()`\n- Project's own `EventEmitter` instead of Node.js `events` module\n- `console.log` with namespace prefixes instead of the `debug` npm package\n\n**Node.js support removed**\n\n- No `faye-websocket` — uses browser `WebSocket` directly\n- No `eventsource` npm package — uses browser `EventSource` directly\n- No Node.js `http`/`https`-based XHR driver\n- No `shims.ts` (ES5 polyfills for old browsers)\n- No Node.js `crypto` — uses Web Crypto API\n\n**Legacy browser support removed**\n\n- No `XDomainRequest` (IE8-9) — deleted `sender/xdr.ts`, `xdr-streaming.ts`, `xdr-polling.ts`\n- No `ActiveXObject(\"htmlfile\")` — deleted `receiver/htmlfile.ts`, `transport/htmlfile.ts`, `createHtmlfile()` from `utils/iframe.ts`\n- No `ActiveXObject(\"Microsoft.XMLHTTP\")` fallback in XHR\n- No IE HTTP status code normalization (1223→204, 12005/12029→0)\n- No `document.attachEvent` / `detachEvent` fallbacks — `addEventListener` only\n- No IE JSONP `script.htmlFor` / `script.onclick` hack\n- No IE `\u003ciframe name=\"...\"\u003e` createElement hack\n- No `script.onreadystatechange` / `iframe.onreadystatechange` IE workarounds\n- No Opera user-agent sniffing (`isOpera()`)\n- No Konqueror user-agent sniffing (`isKonqueror()`)\n- No Chrome packaged app detection (`chrome.app.runtime`)\n- No `CollectGarbage()` IE COM hint\n- No `doc.parentWindow` — IE-specific window reference\n- No `!(this instanceof Constructor)` pattern (impossible with ES `class`)\n- No `protocols_whitelist` deprecated option support\n\n**Dependencies removed**\n\n- `debug` — replaced with `console.log` namespaced calls\n- `eventsource` — browser `EventSource` used directly\n- `faye-websocket` — browser `WebSocket` used directly\n- `inherits` — native `class extends`\n- `url-parse` — native `URL` constructor\n\n### Building\n\n```bash\nbun run build\n```\n\nOutputs ESM bundle to `dist/sockjs.js` with TypeScript declarations via rolldown + `tsc`.\n\n### Testing\n\n```bash\nbun test\n```\n\n### Type checking\n\n```bash\nbun run typecheck\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliasku%2Fsockjs-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliasku%2Fsockjs-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliasku%2Fsockjs-client/lists"}