{"id":20973984,"url":"https://github.com/jamesroutley/kombu","last_synced_at":"2025-09-30T14:33:08.467Z","repository":{"id":75015222,"uuid":"93414765","full_name":"jamesroutley/kombu","owner":"jamesroutley","description":"🍜 A command-line tool for manipulating tabulated data","archived":false,"fork":false,"pushed_at":"2017-06-25T00:07:54.000Z","size":50,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-19T04:29:23.239Z","etag":null,"topics":["cli","data","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesroutley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-06-05T14:51:06.000Z","updated_at":"2017-11-25T05:39:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"a273e825-2566-425f-8d5c-0ba6f8a556d5","html_url":"https://github.com/jamesroutley/kombu","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesroutley%2Fkombu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesroutley%2Fkombu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesroutley%2Fkombu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesroutley%2Fkombu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesroutley","download_url":"https://codeload.github.com/jamesroutley/kombu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234744631,"owners_count":18879955,"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","data","javascript"],"created_at":"2024-11-19T04:25:52.990Z","updated_at":"2025-09-30T14:33:08.128Z","avatar_url":"https://github.com/jamesroutley.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kombu\n\nKombu simplifies interacting with tabulated CLI data. Pipe the output of a shell command to `kombu`, and apply javascript functions to it. It's like using `awk`, without having to learn `awk`.\n\n## Example\n\n```shell\nls | kb \"data.map((n) =\u003e n.concat(' ✨'))\"\nREADME.md ✨\nnode_modules ✨\npackage.json ✨\nsrc ✨\nyarn.lock ✨\n```\n\nMany shell commands output tabulated data:\n\n```shell\n$ df\nFilesystem    512-blocks      Used Available Capacity iused      ifree %iused  Mounted on\n/dev/disk1     487653376 110844640 376296736    23%  876686 4294090593    0%   /\ndevfs                370       370         0   100%     640          0  100%   /dev\n```\n\nTabulated data piped to `kombu` (which I've aliased to `kb`) is read into a 2D array named `data`. The user supplies javascript statements to transform the data. In this example, the full data set is returned by supplying the statement `data`, and `kb` logs it automatically.\n\n```shell\n$ df | kb \"data\"\nFilesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on\n/dev/disk1 487653376 110841568 376299808 23% 876685 4294090594 0% /\ndevfs 370 370 0 100% 640 0 100% /dev\n```\n\nSay we want to get a list of File System  names. First, we slice `data` to remove the columb titles (note kombu can remove titles automatically with the `-t, --title` [flag](#api)):\n\n```shell\n$ df | kb \"data.slice(1)\"\n/dev/disk1 487653376 110841896 376299480 23% 876666 4294090613 0% /\ndevfs 370 370 0 100% 640 0 100% /dev\n```\n\nThen, we apply a `map` to the array to select the first element of each row:\n\n```shell\n$ df | kb \"data.slice(1)\" | kb \"data.map((d) =\u003e d[0])\"\n/dev/disk1\ndevfs\n```\n\n## IO\n\nKombu aims to provide an intuitive experience. The type of `data` should be\nwhat you intuitively expect it to be:\n\n- single strings -\u003e strings\n- 1D lists -\u003e array\n- 2D tables -\u003e nested array\n\nLikewise, output is printed in a sensible format.\n\n## API\n\n```\nUsage: \u003ccommand\u003e | kombu [options] statement\n\nKombu is a command-line tool for manipulating tabulated data.\n\nTabulated data should be piped to kombu, and a statement which transforms the\ndata should be supplied. The data is parsed, and made available to the statment\nvia the variable 'data'.\n\nOptions:\n    -h, --help          Show this message and exit\n    -t, --title         Remove titles, assumed to be at row 0\n```\n\n## Install\n\nWith `npm`:\n\n```\n$ npm install -g kombu\n```\n\n## Alternatives\n\n- [awk](https://www.gnu.org/software/gawk/)\n- [FuncShell](https://github.com/iostreamer-X/FuncShell), which kombu was inspired by\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesroutley%2Fkombu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesroutley%2Fkombu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesroutley%2Fkombu/lists"}