{"id":16644201,"url":"https://github.com/75lb/gfmt","last_synced_at":"2025-07-19T10:34:20.534Z","repository":{"id":34049475,"uuid":"37828585","full_name":"75lb/gfmt","owner":"75lb","description":"A use-anywhere, github-flavoured-markdown table generator.","archived":false,"fork":false,"pushed_at":"2025-05-11T14:29:10.000Z","size":156,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T07:00:56.972Z","etag":null,"topics":["github-flavored-markdown","javascript","markdown","table","text-formatting"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jesseduffield/lazygit","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/75lb.png","metadata":{"files":{"readme":"README.hbs","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":"2015-06-21T22:27:03.000Z","updated_at":"2025-05-11T14:29:12.000Z","dependencies_parsed_at":"2024-10-12T08:20:54.142Z","dependency_job_id":null,"html_url":"https://github.com/75lb/gfmt","commit_stats":{"total_commits":53,"total_committers":1,"mean_commits":53.0,"dds":0.0,"last_synced_commit":"7513667e19443f41e2ea09f41c7ac8d0b0026627"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/75lb/gfmt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fgfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fgfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fgfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fgfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/75lb","download_url":"https://codeload.github.com/75lb/gfmt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fgfmt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265218628,"owners_count":23729516,"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":["github-flavored-markdown","javascript","markdown","table","text-formatting"],"created_at":"2024-10-12T08:10:46.537Z","updated_at":"2025-07-19T10:34:20.526Z","avatar_url":"https://github.com/75lb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![view on npm](https://badgen.net/npm/v/gfmt)](https://www.npmjs.org/package/gfmt)\n[![npm module downloads](https://badgen.net/npm/dt/gfmt)](https://www.npmjs.org/package/gfmt)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/gfmt)](https://github.com/75lb/gfmt/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/gfmt)](https://github.com/75lb/gfmt/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/gfmt/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/gfmt/actions/workflows/node.js.yml)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n# gfmt\n\nA use-anywhere, github-flavoured-markdown table generator. Useful in markdown generators or for presenting table data in the terminal.\n\n## Synopsis\n\nWhere `example/simple.json` looks like this:\n```\n[\n    { \"date\": \"10 Jun 2015\", \"downloads\": 100 },\n    { \"date\": \"11 Jun 2015\", \"downloads\": 120 },\n    { \"date\": \"12 Jun 2015\", \"downloads\": 150 },\n    { \"date\": \"13 Jun 2015\", \"downloads\": 120 },\n    { \"date\": \"14 Jun 2015\", \"downloads\": 110 }\n]\n```\n\nthis command:\n```sh\n$ cat example/simple.json | gfmt\n```\n\nproduces this output:\n```\n| date        | downloads |\n| ----------- | --------- |\n| 10 Jun 2015 | 100       |\n| 11 Jun 2015 | 120       |\n| 12 Jun 2015 | 150       |\n| 13 Jun 2015 | 120       |\n| 14 Jun 2015 | 110       |\n```\n\nThis command pipes cherry-picked fields from a github repo list into `gfmt`:\n```sh\n$ curl -s \"https://api.github.com/users/jsdoc2md/repos\" \\\n| jq 'map({repo:.name, stars:.stargazers_count, forks:.forks_count, issues:.open_issues_count}) | sort_by(.stargazers_count) | reverse' \\\n| gfmt\n```\n\nproduces this output:\n```\n| repo                    | stars | forks | issues |\n| ----------------------- | ----- | ----- | ------ |\n| jsdoc-to-markdown       | 133   | 20    | 18     |\n| jsdoc-parse             | 26    | 8     | 4      |\n| jsdoc                   | 0     | 1     | 0      |\n| gulp-jsdoc-to-markdown  | 6     | 2     | 0      |\n| grunt-jsdoc-to-markdown | 12    | 2     | 1      |\n| ddata                   | 0     | 2     | 2      |\n| dmd-locale-en-gb        | 0     | 0     | 0      |\n| dmd-bitbucket           | 0     | 1     | 0      |\n| dmd                     | 13    | 10    | 5      |\n| dhtml                   | 0     | 0     | 0      |\n| dmd-plugin-example      | 0     | 1     | 0      |\n```\n\n## Install\n\nAs a library:\n\n```\n$ npm install gfmt --save\n```\n\nAs a command-line tool:\n```\n$ npm install -g gfmt\n```\n\nRun `gfmt --help` to see the command-line options.\n\n## API Reference\n\nA use-anywhere, github-flavoured-markdown table generator.\n\n\u003ca name=\"exp_module_gfmt--gfmTable\"\u003e\u003c/a\u003e\n\n### gfmTable(data, [options]) ⇒ \u003ccode\u003estring\u003c/code\u003e ⏏\nGet a github-flavoured-markdown table instance\n\n**Kind**: Exported function\n\n| Param | Type | Description |\n| --- | --- | --- |\n| data | \u003ccode\u003eobject\u003c/code\u003e \u0026#124; \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e | the input data |\n| [options] | \u003ccode\u003eobject\u003c/code\u003e |  |\n| [options.columns] | \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e | column definitions |\n| [options.wrap] | \u003ccode\u003eboolean\u003c/code\u003e | wrap to fit into width |\n| [options.width] | \u003ccode\u003eboolean\u003c/code\u003e | table width |\n| [options.ignoreEmptyColumns] | \u003ccode\u003eboolean\u003c/code\u003e | table width |\n\n**Example**\n```js\n\u003e gfmt = require(\"gfmt\")\n\u003e table = gfmt([\n    { \"date\": \"10 Jun 2015\", \"downloads\": 100 },\n    { \"date\": \"11 Jun 2015\", \"downloads\": 120 },\n    { \"date\": \"12 Jun 2015\", \"downloads\": 150 },\n    { \"date\": \"13 Jun 2015\", \"downloads\": 120 },\n    { \"date\": \"14 Jun 2015\", \"downloads\": 110 }\n])\n\u003e console.log(table.getTable())\n| date        | downloads |\n| ----------- | --------- |\n| 10 Jun 2015 | 100       |\n| 11 Jun 2015 | 120       |\n| 12 Jun 2015 | 150       |\n| 13 Jun 2015 | 120       |\n| 14 Jun 2015 | 110       |\n```\n* * *\n\n\u0026copy; 2015-25 Lloyd Brookes \\\u003copensource@75lb.com\\\u003e. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fgfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F75lb%2Fgfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fgfmt/lists"}