{"id":15239083,"url":"https://github.com/dbushell/xml-streamify","last_synced_at":"2025-07-23T03:05:42.611Z","repository":{"id":201161017,"uuid":"707071514","full_name":"dbushell/xml-streamify","owner":"dbushell","description":"Fetch and parse XML with JavaScript web streams and async iterators ✨","archived":false,"fork":false,"pushed_at":"2025-07-15T16:30:44.000Z","size":51,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-16T12:22:55.183Z","etag":null,"topics":["async","bun","deno","iterator","javascript","nodejs","stream","xml"],"latest_commit_sha":null,"homepage":"","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/dbushell.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":"2023-10-19T07:03:32.000Z","updated_at":"2025-07-15T16:30:47.000Z","dependencies_parsed_at":"2024-03-03T10:26:36.403Z","dependency_job_id":"45a00e2a-d765-40a7-b7c8-dc0075676ccb","html_url":"https://github.com/dbushell/xml-streamify","commit_stats":null,"previous_names":["dbushell/xml-streamify"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dbushell/xml-streamify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Fxml-streamify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Fxml-streamify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Fxml-streamify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Fxml-streamify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbushell","download_url":"https://codeload.github.com/dbushell/xml-streamify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbushell%2Fxml-streamify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266609041,"owners_count":23955566,"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-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["async","bun","deno","iterator","javascript","nodejs","stream","xml"],"created_at":"2024-09-29T10:05:11.361Z","updated_at":"2025-07-23T03:05:42.492Z","avatar_url":"https://github.com/dbushell.png","language":"TypeScript","readme":"# 📰 XML Streamify\n\n[![JSR](https://jsr.io/badges/@dbushell/xml-streamify?labelColor=98e6c8\u0026color=333)](https://jsr.io/@dbushell/xml-streamify) [![NPM](https://img.shields.io/npm/v/@dbushell/xml-streamify?labelColor=98e6c8\u0026color=333)](https://www.npmjs.com/package/@dbushell/xml-streamify)\n\nFetch and parse XML documents using the power of JavaScript web streams and async iterators ✨\n\n* Small, fast, zero dependencies †\n* Work with data before the fetch is complete\n* Cross-runtime support (Bun, Deno, Node, and web browsers)\n\n**This is experimental work in progress.** But it does seem to work. It was designed to parse RSS feeds.\n\n## Usage\n\nThe `parse` generator function is the main export. Below is a basic example that logs RSS item titles as they're found:\n\n```javascript\nimport {parse} from \"@dbushell/xml-streamify\";\n\nfor await (const node of parse('https://dbushell.com/rss.xml')) {\n  if (node.is('channel', 'item')) {\n    console.log(node.first('title').innerText);\n  }\n}\n```\n\nSee [`src/types.ts`](/src/types.ts) for `parse` options.\n\n`parse` uses a lower level `XMLStream` that can be used alone:\n\n```javascript\nconst response = await fetch('https://dbushell.com/rss.xml');\nconst stream = response.body.pipeThrough(new XMLStream());\nfor await (const [type, value] of stream) {\n  // e.g. declaration: \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n  console.log(`${type}: ${value}`);\n}\n```\n\n## Advanced\n\nSee the `examples` directory for more advanced and platform specific examples.\n\nIn the `examples/advanced` directory there is a Deno web server. It will proxy RSS feeds, add CORS headers, and throttle streaming speed for testing. Run `deno run -A examples/advanced/mod.ts` for the full example script.\n\n## Notes\n\nThis project may not be fully XML compliant. It can handle XHTML in some cases. It will not parse HTML where elements like `\u003cmeta charset=\"utf-8\"\u003e` are not self-closing and `\u003cli\u003e` do not require a closing `\u003c/li\u003e` for example.\n\nBrowsers may need a [polyfill](https://bugs.chromium.org/p/chromium/issues/detail?id=929585#c10) until they support async iterator on `ReadableStream`.\n\n† bring your own HTML entities decoder\n\n* * *\n\n[MIT License](/LICENSE) | Copyright © 2024 [David Bushell](https://dbushell.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbushell%2Fxml-streamify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbushell%2Fxml-streamify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbushell%2Fxml-streamify/lists"}