{"id":22374329,"url":"https://github.com/yatharthx/cli-pen","last_synced_at":"2026-05-16T08:39:17.921Z","repository":{"id":57200092,"uuid":"76630528","full_name":"yatharthx/cli-pen","owner":"yatharthx","description":"Elegant CLI helper for NodeJS terminal apps.","archived":false,"fork":false,"pushed_at":"2017-02-09T03:55:13.000Z","size":51,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-04T10:17:54.168Z","etag":null,"topics":["cli","cli-utilities","command-line-tool","elegant-cli-helper","javascript","node-module","nodejs","progressbar","spinner","stream"],"latest_commit_sha":null,"homepage":null,"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/yatharthx.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-12-16T07:07:07.000Z","updated_at":"2018-05-24T10:00:27.000Z","dependencies_parsed_at":"2022-09-16T15:00:52.530Z","dependency_job_id":null,"html_url":"https://github.com/yatharthx/cli-pen","commit_stats":null,"previous_names":["yatharthk/cli-pen","yatharthx/cli-pen"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yatharthx/cli-pen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yatharthx%2Fcli-pen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yatharthx%2Fcli-pen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yatharthx%2Fcli-pen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yatharthx%2Fcli-pen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yatharthx","download_url":"https://codeload.github.com/yatharthx/cli-pen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yatharthx%2Fcli-pen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267451489,"owners_count":24089312,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cli","cli-utilities","command-line-tool","elegant-cli-helper","javascript","node-module","nodejs","progressbar","spinner","stream"],"created_at":"2024-12-04T21:16:48.166Z","updated_at":"2026-05-16T08:39:17.878Z","avatar_url":"https://github.com/yatharthx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cli-pen [![Build Status](https://travis-ci.org/yatharthk/cli-pen.svg?branch=master)](https://travis-ci.org/yatharthk/cli-pen) [![Coverage Status](https://coveralls.io/repos/github/yatharthk/cli-pen/badge.svg?branch=master)](https://coveralls.io/github/yatharthk/cli-pen?branch=master)\n\u003e Elegant CLI helper for NodeJS terminal apps.\n\n**Note**: APIs may change in near future releases. The APIs are expected to get stable after the first major release (v1.0.0). You can help improve the APIs / API format by raising an issue.\n\n## Install\n```\nnpm install --save cli-pen\n```\n\nCurrently, the tools provided by **cli-pen** include:\n- Pen\n- ProgressBar\n- Spinner\n\n## Pen\nA pen is a simple console utility to replace your `console.log` usage in the NodeJS terminal apps.\n\n![Pen example GIF](/screenshot-pen.gif)\n\n## Usage\n```js\nconst { Pen } = require('cli-pen');\nconst pen = Pen();\npen.info('Console some information.');\npen.warn('Some warning', {\n  format: ':symbol :message',\n});\n```\n\n## API\n\n### Pen([options])\n`options` are optional. If not provided, default values are used.\n\n#### options\nType: `object`\n\n##### format\nType: `string`\nDefault: `:symbol :title :message\\n`\n\n\n\n##### color\nType: `object | string `\nDefault: `gray`\n\n**Note:** If a string is used, all types `error` `info` `success` `warning` (for `:message`) use the same color.\n\nYou can provide an object for custom color configuration like:\n\n```js\n{\n  error: 'red',\n  info: 'white',\n  success: 'green',\n  warning: 'yellow'\n}\n```\n\n##### titleColor\nType: `object | string`\nDefault: `error: red` `info: blue` `success: green` `warning: yellow`\n\n**Note:** If a string is used, all types `error` `info` `success` `warning` (for `:title`) use the same color.\n\nYou can provide custom colors for titles in a similar way as for `color`.\n\n##### title\nType: `object | string`\n\nDefault: `error: error` `info: info` `success: success` `warning: warning`\n\n**Note:** If a string is used, all types `error` `info` `success` `warning` (for `:title`) use the same text.\n\n##### stream\nType: `WriteableStream`\nDefault: `process.stderr`\n\nStream to write on terminal.\n\nOptions: `process.stdout`\n\n#### Instance\n\n- .error(message [, options])\nWrite an error message to console.\n\n- .info(message [, options])\nWrite an info message to console.\n\n- .success(message [, options])\nWrite a success message to console.\n\n- .warning(message [, options])\nWrite a warning message to console.\n\n- .log(message)\nAn alternative to native `console.log`. Use it in a similar fashion.\n\n##### message\nType: `string | Array\u003cstring\u003e`\n\n##### options\nType: `object`\n\nA typical options parameter example would be like:\n```js\n{\n  format: ':symbol :message\\n',\n  color: 'blue',\n}\n```\n\n## ProgressBar\nA simple **ProgressBar** for terminal apps.\n\n![ProgressBar example GIF](/screenshot-progressbar.gif)\n\n## Usage\n```js\nconst { ProgressBar } = require('cli-pen');\nconst progress = ProgressBar(30);\nprogress.tick(10);\nsetTimeout(() =\u003e {\n  progress.tick(20);\n  console.log('task completed.');\n}, 1500);\n```\n\n## API\n### ProgressBar(total)\n`total` is the number of ticks to complete.\n\n### Instance\n#### .tick([progress])\nA single call on tick increments the progress by `1`. If an optional `progress` is passed, the progress is increments by that number.\n\n## Spinner\nA simple **Spinner** for terminal apps.\n\n![Spinner example GIF](/screenshot-spinner.gif)\n\n## Usage\n```js\nconst { Spinner } = require('cli-pen');\nconst spinner = Spinner({\n  color: 'blue',\n});\nspinner.start();\n```\n\n## API\n### Spinner([options|text])\n\nIf a string is provided, it would work as `options.text`.\n\n#### options\nType: `object`\n\n##### text\nType: `string`\n\nText to display after the spinner.\n\n##### format\nType: `string`\nDefault: `:spinner :text`\n\n##### spinner\nType: `string` `object`\nDefault: `line`\n\nYou can look for list of available spinners [here](https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json).\n\n##### color\nType: `string`\nDefault: `white`\nValues: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `gray`\n\nColor of the spinner.\n\n##### stream\nType: `WriteableStream`\nDefault: `process.stderr`\n\nStream to write on terminal.\n\nOptions: `process.stdout`\n\n### Instance\n\n##### .start()\nStarts the spinner.\n\n##### .stop()\nStops the spinner.\n\n##### .info(message)\nStops the spinner with an information `message`.\n\n##### .succeed(message)\nStops the spinner with a success `message`.\n\n##### .warn(message)\nStops the spinner with a warning `message`.\n\n##### .fail(message)\nStops the spinner with a failure `message`.\n\n##### .text\nChange the text of the spinner\n\n##### .color\nChange the color of the spinner\n\n\n## Inspiration\n**CLI-PEN** is inspired by some amazing cli tools as [ora](https://github.com/sindresorhus/ora), [progress](https://github.com/visionmedia/node-progress) and few others.\n\nCLI-PEN aims to be a fully featured cli tool for terminal apps built on NodeJS.\n\n\n## License\nMIT © Yatharth Khatri\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyatharthx%2Fcli-pen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyatharthx%2Fcli-pen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyatharthx%2Fcli-pen/lists"}