{"id":13396687,"url":"https://github.com/shannonmoeller/cli-columns","last_synced_at":"2025-04-07T06:11:04.257Z","repository":{"id":57199980,"uuid":"51668141","full_name":"shannonmoeller/cli-columns","owner":"shannonmoeller","description":"Columnated lists for the CLI. Unicode and ANSI safe.","archived":false,"fork":false,"pushed_at":"2021-11-03T05:40:01.000Z","size":29,"stargazers_count":36,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T05:04:24.781Z","etag":null,"topics":["cli","column","columnate","columns","nodejs"],"latest_commit_sha":null,"homepage":"http://npm.im/cli-columns","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/shannonmoeller.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":"2016-02-13T22:09:35.000Z","updated_at":"2025-02-20T01:31:11.000Z","dependencies_parsed_at":"2022-09-06T11:11:47.242Z","dependency_job_id":null,"html_url":"https://github.com/shannonmoeller/cli-columns","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shannonmoeller%2Fcli-columns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shannonmoeller%2Fcli-columns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shannonmoeller%2Fcli-columns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shannonmoeller%2Fcli-columns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shannonmoeller","download_url":"https://codeload.github.com/shannonmoeller/cli-columns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"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","column","columnate","columns","nodejs"],"created_at":"2024-07-30T18:01:00.133Z","updated_at":"2025-04-07T06:11:04.232Z","avatar_url":"https://github.com/shannonmoeller.png","language":"JavaScript","readme":"# `cli-columns`\n\n[![NPM version][npm-img]][npm-url] [![Downloads][downloads-img]][npm-url]\n\nColumnated lists for the CLI. Unicode and ANSI safe.\n\n## Install\n\n    $ npm install --save cli-columns\n\n## Usage\n\n```js\nconst columns = require('cli-columns');\nconst chalk = require('chalk');\n\nconst values = [\n    'blue' + chalk.bgBlue('berry'),\n    '笔菠萝' + chalk.yellow('苹果笔'),\n    chalk.red('apple'), 'pomegranate',\n    'durian', chalk.green('star fruit'),\n    'パイナップル', 'apricot', 'banana',\n    'pineapple', chalk.bgRed.yellow('orange')\n];\n\nconsole.log(columns(values));\n```\n\n\u003cimg alt=\"screenshot\" src=\"https://user-images.githubusercontent.com/155164/28672800-bd415c86-72ae-11e7-855c-6f6aa108921b.png\"\u003e\n\n## API\n\n### columns(values [, options]): String\n\n- `values` `{Array\u003cString\u003e}` Array of strings to display.\n- `options` `{Object}`\n  - `character` `{String}` (default: `' '`) Padding character.\n  - `newline` `{String}` (default: `'\\n'`) Newline character.\n  - `padding` `{Number}` (default: `2`) Space between columns.\n  - `sort` `{Boolean}` (default: `true`) Whether to sort results.\n  - `width` `{Number}` (default: `process.stdout.columns`) Max width of list.\n\nSorts and formats a list of values into columns suitable to display in a given width.\n\n## Contribute\n\nStandards for this project, including tests, code coverage, and semantics are enforced with a build tool. Pull requests must include passing tests with 100% code coverage and no linting errors.\n\n### Test\n\n    $ npm test\n\n----\n\nMIT © [Shannon Moeller](http://shannonmoeller.com)\n\n[downloads-img]: http://img.shields.io/npm/dm/cli-columns.svg?style=flat-square\n[npm-img]:       http://img.shields.io/npm/v/cli-columns.svg?style=flat-square\n[npm-url]:       https://npmjs.org/package/cli-columns\n","funding_links":[],"categories":["打印","Packages","包","Command-line utilities","目录"],"sub_categories":["Command-line utilities","命令行工具","命令行实用工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshannonmoeller%2Fcli-columns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshannonmoeller%2Fcli-columns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshannonmoeller%2Fcli-columns/lists"}