{"id":20948280,"url":"https://github.com/raine/html-table-cli","last_synced_at":"2025-05-14T02:30:42.424Z","repository":{"id":49337555,"uuid":"160932044","full_name":"raine/html-table-cli","owner":"raine","description":"Create interactive tables from JSON on the command-line","archived":false,"fork":false,"pushed_at":"2018-12-13T12:21:24.000Z","size":2140,"stargazers_count":26,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-31T17:57:37.875Z","etag":null,"topics":["cli","json","react","table"],"latest_commit_sha":null,"homepage":"","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/raine.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":"2018-12-08T11:22:18.000Z","updated_at":"2022-07-24T16:51:46.000Z","dependencies_parsed_at":"2022-08-27T01:40:23.191Z","dependency_job_id":null,"html_url":"https://github.com/raine/html-table-cli","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Fhtml-table-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Fhtml-table-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Fhtml-table-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Fhtml-table-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raine","download_url":"https://codeload.github.com/raine/html-table-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225270596,"owners_count":17447635,"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","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":["cli","json","react","table"],"created_at":"2024-11-19T00:16:59.133Z","updated_at":"2024-11-19T00:16:59.560Z","avatar_url":"https://github.com/raine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# html-table-cli\n\n\u003ca href=\"https://raine.github.io/html-table-cli/github-trending.html\"\u003e\n  \u003cimg align=\"right\" width=\"240\" src=\"https://raine.github.io/html-table-cli/github-trending_thumb.png\"/\u003e\n\u003c/a\u003e\n\nCreate interactive tables from JSON on the command-line.\n\n## key features\n\n- takes JSON via stdin, writes a standalone HTML file to stdout\n- alternatively, view instantly in browser with `--open`\n- customize column-specific rendering through arguments\n- uses [`react-table`](https://react-table.js.org/)\n\n## install\n\n```sh\nnpm install -g html-table-cli\n```\n\n## usage\n\n```sh\ncat data.json | html-table\n```\n\n## options\n\n```\nUsage: html-table [options]\n\n  Render JSON as an interactive table to be viewed in a web browser.\n  By default, reads JSON from stdin and renders HTML to stdout.\n\n  Expected structure of input is [ object, object, ... ], where each object is\n  of the same shape.\n\n  -o, --open             write to a temp file and open in browser\n  -h, --help             view help\n\n  Customization:\n\n  --col.$key.width       set width of a column\n  --col.$key.header      set how header for a column is rendered\n  --col.$key.cell        set how cell for a column is rendered\n  --col.$key.parse       function to apply to values of specific column\n  --col.$key.filterable  make column filterable\n  --cols                 comma-separated list of keys to be shown as columns\n  --generated-at         show a timestamp of page generation at bottom\n  --[no-]pagination      enable \u0026 disable pagination\n\n  Where $key is name of a key that appears in the provided list of objects.\n```\n\n## examples\n\nThe examples below use `npx` that comes with npm to install `html-table-cli` on\ndemand, hence no installation is necessary to run them.\n\n### trending repositories on github\n\n```sh\ncurl -s https://github-trending-api.now.sh/repositories\\?since=weekly |\\\n  npx html-table-cli -o --generated-at \\\n    --cols project,description,languageColor,language,stars,forks \\\n    --col.project.cell '\u003ca href=\"${url}\"\u003e${author}/${name}\u003c/a\u003e' \\\n    --col.project.width 250  \\\n    --col.languageColor.width 20  \\\n    --col.languageColor.cell \\\n      '\u003cdiv style=\"background-color: ${languageColor}; border-radius: 500px; width: 10px; height: 10px; display: inline-block;\" /\u003e' \\\n    --col.languageColor.header '' \\\n    --col.language.width 120  \\\n    --col.stars.width 100 \\\n    --col.forks.width 100\n```\nhttps://raine.github.io/html-table-cli/github-trending.html\n\n\u003cimg src=\"https://raine.github.io/html-table-cli/github-trending.png\"/\u003e\n\n### countries\n\n```sh\ncurl -s https://restcountries.eu/rest/v2/all | \\\n  npx html-table-cli -o \\\n    --cols flag,code,name,population,area,capital,tld,languages \\\n    --col.flag.cell '\u003cdiv style=\"text-align: center\"\u003e\u003cimg src=\"${flag}\" height=\"20\" /\u003e\u003c/div\u003e' \\\n    --col.flag.header '' \\\n    --col.flag.width 50 \\\n    --col.code.width 40 \\\n    --col.code.cell '${alpha2Code}' \\\n    --col.code.header '' \\\n    --col.name.cell '\u003cspan\u003e${name} (${nativeName})\u003c/span\u003e' \\\n    --col.name.filterable \\\n    --col.tld.cell '\u003ccode\u003e${topLevelDomain[0]}\u003c/code\u003e' \\\n    --col.tld.header 'TLD' \\\n    --col.tld.width 50 \\\n    --col.languages.cell '\u003cspan\u003e${languages.map(x =\u003e x.name).join(\", \")}\u003c/span\u003e' \\\n    --col.languages.header 'Languages' \\\n    --col.population.cell '${population.toLocaleString()}' \\\n    --col.area.cell '${area.toLocaleString()}'\n```\n\nhttps://raine.github.io/html-table-cli/countries.html\n\n\u003cimg src=\"https://raine.github.io/html-table-cli/countries.png\"/\u003e\n\n## other notes\n\nGoes well with [`ramda-cli`](https://github.com/raine/ramda-cli). Manipulate the\nJSON before passing to `html-table-cli` or use to convert a csv file to json.\n\ne.g. `cat mydata.csv | ramda -i csv identity | html-table`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraine%2Fhtml-table-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraine%2Fhtml-table-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraine%2Fhtml-table-cli/lists"}