{"id":26294457,"url":"https://github.com/chrismichaelps/parse-html-table","last_synced_at":"2026-04-14T17:31:51.893Z","repository":{"id":167990250,"uuid":"643629311","full_name":"chrismichaelps/parse-html-table","owner":"chrismichaelps","description":"A lightweight library for parsing HTML tables into structured data using TypeScript.","archived":false,"fork":false,"pushed_at":"2023-05-21T19:12:14.000Z","size":135,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-03T10:29:35.196Z","etag":null,"topics":["cheerio-table-parser","parse-html-table","table-parser"],"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/chrismichaelps.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-05-21T19:06:12.000Z","updated_at":"2024-11-28T08:02:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"280c2e4b-30ec-454a-b64a-06fa8eb00867","html_url":"https://github.com/chrismichaelps/parse-html-table","commit_stats":null,"previous_names":["chrismichaelperezsantiago/parse-html-table","chrismichaelps/parse-html-table"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chrismichaelps/parse-html-table","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismichaelps%2Fparse-html-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismichaelps%2Fparse-html-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismichaelps%2Fparse-html-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismichaelps%2Fparse-html-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrismichaelps","download_url":"https://codeload.github.com/chrismichaelps/parse-html-table/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismichaelps%2Fparse-html-table/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31808505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cheerio-table-parser","parse-html-table","table-parser"],"created_at":"2025-03-15T03:20:00.371Z","updated_at":"2026-04-14T17:31:51.875Z","avatar_url":"https://github.com/chrismichaelps.png","language":"TypeScript","readme":"# ✓ parse-html-table\n\n\u003e A lightweight library for parsing HTML tables into structured data using TypeScript.\n\n## 📦 Installation\n\n### npm\n\n```shell\nnpm install parse-html-table\n```\n\n### yarn\n\n```shell\nyarn add parse-html-table\n```\n\n# 📚 Documentation\n\n## Usage\n\n```typescript\nimport {\n  createTableParser,\n  RowData,\n  TableParserFactory,\n} from \"parse-html-table\";\n\n// Define the specific row data interface\ninterface PersonData extends RowData {\n  name: string;\n  age: string;\n  country: string;\n}\n\n// Create a specific table parser factory\nexport const personTableParserFactory: TableParserFactory\u003cPersonData\u003e =\n  createTableParser\u003cPersonData\u003e();\n\n// Example HTML table 1\nconst html1 = `\n  \u003ctable\u003e\n    \u003cthead\u003e\n      \u003ctr\u003e\n        \u003cth\u003ename\u003c/th\u003e\n        \u003cth\u003eage\u003c/th\u003e\n        \u003cth\u003ecountry\u003c/th\u003e\n      \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eJohn Doe\u003c/td\u003e\n        \u003ctd\u003e30\u003c/td\u003e\n        \u003ctd\u003eUSA\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eJane Smith\u003c/td\u003e\n        \u003ctd\u003e25\u003c/td\u003e\n        \u003ctd\u003eCanada\u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/tbody\u003e\n  \u003c/table\u003e\n`;\n\n// Example HTML table 2\n// Parse the name of the columns if they have spaces as cameoCase correctly\nconst html2 = `\n  \u003ctable\u003e\n    \u003cthead\u003e\n      \u003ctr\u003e\n        \u003cth\u003efull name\u003c/th\u003e\n        \u003cth\u003efull age\u003c/th\u003e\n        \u003cth\u003efull country\u003c/th\u003e\n      \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eJohn Doe\u003c/td\u003e\n        \u003ctd\u003e30\u003c/td\u003e\n        \u003ctd\u003eUSA\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eJane Smith\u003c/td\u003e\n        \u003ctd\u003e25\u003c/td\u003e\n        \u003ctd\u003eCanada\u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/tbody\u003e\n  \u003c/table\u003e\n`;\n\n// Example HTML table 3 (empty table)\nconst html3 = \"\";\n\n// Parse table 1\nconst tableParser1 = personTableParserFactory(html1);\nconst tableData1 = tableParser1();\nconsole.log(\"Table 1 Data:\", tableData1);\n\n// Parse table 2\nconst tableParser2 = personTableParserFactory(html2);\nconst tableData2 = tableParser2();\nconsole.log(\"Table 2 Data:\", tableData2);\n\n// Parse table 3\nconst tableParser3 = personTableParserFactory(html3);\nconst tableData3 = tableParser3();\nconsole.log(\"Table 3 Data:\", tableData3);\n```\n\n```typescript\n// table 1\n{\n  headers: [ 'name', 'age', 'country' ],\n  rows: [\n    { name: 'John Doe', age: '30', country: 'USA' },\n    { name: 'Jane Smith', age: '25', country: 'Canada' }\n  ]\n}\n\n// table 2\n{\n  headers: [ 'fullName', 'fullAge', 'fullCountry' ],\n  rows: [\n    { fullName: 'John Doe', fullAge: '30', fullCountry: 'USA' },\n    { fullName: 'Jane Smith', fullAge: '25', fullCountry: 'Canada' }\n  ]\n}\n\n// table 3\n{ \n  headers: [], \n  rows: [] \n}\n```\n\n## **:handshake: Contributing**\n\n- Fork it!\n- Create your feature branch: `git checkout -b my-new-feature`\n- Commit your changes: `git commit -am 'Add some feature'`\n- Push to the branch: `git push origin my-new-feature`\n- Submit a pull request\n\n---\n\n### **:busts_in_silhouette: Credits**\n\n- [Chris Michael](https://github.com/ChrisMichaelPerezSantiago) (Project Leader, and Developer)\n\n---\n\n### **:anger: Troubleshootings**\n\nThis is just a personal project created for study / demonstration purpose and to simplify my working life, it may or may\nnot be a good fit for your project(s).\n\n---\n\n### **:heart: Show your support**\n\nPlease :star: this repository if you like it or this project helped you!\\\nFeel free to open issues or submit pull-requests to help me improving my work.\n\n---\n\n### **:robot: Author**\n\n_*Chris M. Perez*_\n\n\u003e You can follow me on\n\u003e [github](https://github.com/ChrisMichaelPerezSantiago)\u0026nbsp;\u0026middot;\u0026nbsp;[twitter](https://twitter.com/Chris5855M)\n\n---\n\nCopyright ©2023 [parse-html-table](https://github.com/ChrisMichaelPerezSantiago/parse-html-table).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrismichaelps%2Fparse-html-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrismichaelps%2Fparse-html-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrismichaelps%2Fparse-html-table/lists"}