{"id":16419114,"url":"https://github.com/cameronhunter/table","last_synced_at":"2026-05-16T10:32:38.179Z","repository":{"id":143736694,"uuid":"425091687","full_name":"cameronhunter/table","owner":"cameronhunter","description":"A tagged template for defining a table of data.","archived":false,"fork":false,"pushed_at":"2021-11-08T19:10:27.000Z","size":147,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-29T05:20:48.810Z","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/cameronhunter.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":"2021-11-05T21:43:58.000Z","updated_at":"2021-11-08T19:10:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f05f47f-57b9-410e-8939-d7ce200cfcf9","html_url":"https://github.com/cameronhunter/table","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cameronhunter/table","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Ftable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Ftable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Ftable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Ftable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cameronhunter","download_url":"https://codeload.github.com/cameronhunter/table/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Ftable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33098795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"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":[],"created_at":"2024-10-11T07:15:58.429Z","updated_at":"2026-05-16T10:32:38.160Z","avatar_url":"https://github.com/cameronhunter.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Table ![CI](https://github.com/cameronhunter/table/actions/workflows/ci.yml/badge.svg) [![npm version](https://img.shields.io/npm/v/@cameronhunter/table)](https://npmjs.com/package/@cameronhunter/table)\n\nCreate an array of objects from a table of data defined in a template string.\n\n## Runtime\n\nThe default import will convert the table into an array of objects at runtime.\n\n```ts\nimport table from '@cameronhunter/table';\n\ntype Data = {\n  cell: number;\n  presentation: 'slideshow' | 'static';\n  preloading: boolean;\n};\n\nconst data: Data[] = table`\n  cell | presentation   | preloading\n  ${2} | ${'slideshow'} | ${true}\n  ${3} | ${'static'}    | ${true}\n  ${4} | ${'slideshow'} | ${false}\n  ${5} | ${'static'}    | ${false}\n`;\n```\n\n## Babel Macro\n\nThe babel macro will convert the table into an array of objects at build time.\nThe usage is the same as the runtime function, just a different import.\n\n```ts\nimport table from '@cameronhunter/table/macro';\n\ntype Data = {\n  cell: number;\n  presentation: 'slideshow' | 'static';\n  preloading: boolean;\n};\n\nconst data: Data[] = table`\n  cell | presentation   | preloading\n  ${2} | ${'slideshow'} | ${true}\n  ${3} | ${'static'}    | ${true}\n  ${4} | ${'slideshow'} | ${false}\n  ${5} | ${'static'}    | ${false}\n`;\n```\n\n↓ ↓ ↓ ↓ ↓ ↓\n\n```ts\ntype Data = {\n  cell: number;\n  presentation: 'slideshow' | 'static';\n  preloading: boolean;\n};\n\nconst data: Data[] = [\n  {\n    cell: 2,\n    presentation: 'slideshow',\n    preloading: true\n  },\n  {\n    cell: 3,\n    presentation: 'static',\n    preloading: true\n  },\n  {\n    cell: 4,\n    presentation: 'slideshow',\n    preloading: false\n  },\n  {\n    cell: 5,\n    presentation: 'static',\n    preloading: false\n  }\n];\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronhunter%2Ftable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcameronhunter%2Ftable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronhunter%2Ftable/lists"}