{"id":22213981,"url":"https://github.com/xmlking/nodeui","last_synced_at":"2025-03-25T06:23:56.994Z","repository":{"id":142313667,"uuid":"88404469","full_name":"xmlking/nodeui","owner":"xmlking","description":":lips: Command Line UI components for Node.js","archived":false,"fork":false,"pushed_at":"2017-04-21T23:35:38.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T05:43:19.064Z","etag":null,"topics":["cli","clui","draftlog","nodejs","ui-components"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/xmlking.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-04-16T09:50:02.000Z","updated_at":"2022-05-28T12:05:19.000Z","dependencies_parsed_at":"2024-02-15T05:43:33.948Z","dependency_job_id":null,"html_url":"https://github.com/xmlking/nodeui","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fnodeui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fnodeui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fnodeui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fnodeui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmlking","download_url":"https://codeload.github.com/xmlking/nodeui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245409548,"owners_count":20610549,"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","clui","draftlog","nodejs","ui-components"],"created_at":"2024-12-02T21:12:51.828Z","updated_at":"2025-03-25T06:23:56.971Z","avatar_url":"https://github.com/xmlking.png","language":"TypeScript","readme":"Node UI\n=======\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][downloads-image]][downloads-url]\n\nCommand Line UI components for Node.js\n\n\u003e This module is based on [clui](https://github.com/nathanpeck/clui) and [draftlog](https://github.com/ivanseidel/node-draftlog)\n \n:: [Setup](#setup)\n:: [Usage](#usage)\n:: [Test](#test)\n:: [Build](#build)\n\n### Setup\n\u003e Installing this module in your project\n```bash\nyarn add nodeui\n# or via npm\nnpm install nodeui\n```\n\n### Usage \n```ts\nimport * as chalk from 'chalk';\nimport  {Banner, Gauge, Spinner, Sparkline, Progress, Line, LineBuffer} from 'nodeui'\n(async () =\u003e {\n    try {\n        const banner = new Banner('  Node UI is Awesome!    See what you can build with this module   ');\n    \n        let spinner = new Spinner('initial message');\n        spinner.start();\n        await sleep(800);\n        spinner.message = 'still working...';\n        await sleep(800);\n        spinner.message = 'almost done...';\n        await sleep(800);\n        spinner.stop()\n    } catch (err) {\n        console.log('Error:::', err)\n    }\n})();\n```\n\n```ts\nasync function* getProgressSlowly() {\n    let progress = 0;\n\n    while (progress \u003c= 100) {\n        await sleep(50);\n        progress += Math.round(Math.random() * 5);\n        if (progress \u003e= 100) {\n            yield 100;\n        } else {\n            yield progress;\n        }\n    }\n}\n\nasync function startDownload() {\n    let myProgress = new Progress(50, chalk.green('Finished download!'));\n\n    for await (let progress of getProgressSlowly()) {\n        myProgress.update(progress, 100)\n    }\n}\n\n(async () =\u003e {\n    console.log('Starting downloads...');\n    for (let i = 0; i \u003c 10; i ++) {\n        startDownload()\n    }\n})();\n```\n\n## Developer Setup\n\n### Setup\n```bash\nyarn\n```\n\n### Build\n```bash\nyarn run build\n```\n### Examples\n```bash\n# ts-node examples.js\nts-node --disableWarnings  examples.ts\n```\n\n### Test\n```bash\nyarn run test\n```\n\n### Publish\n```bash\nyarn run prepublishOnly\ncd dist\nnpm publish\n```\n\n\n[npm-image]: https://img.shields.io/npm/v/nodeui.svg?style=flat\n[npm-url]: https://npmjs.org/package/nodeui\n[downloads-image]: https://img.shields.io/npm/dm/nodeui.svg?style=flat\n[downloads-url]: https://npmjs.org/package/nodeui","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmlking%2Fnodeui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmlking%2Fnodeui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmlking%2Fnodeui/lists"}