{"id":19933828,"url":"https://github.com/pawap90/scrollable-cli","last_synced_at":"2025-11-03T17:38:55.437Z","repository":{"id":182883832,"uuid":"666889248","full_name":"pawap90/scrollable-cli","owner":"pawap90","description":"Scrollable areas for the terminal","archived":false,"fork":false,"pushed_at":"2024-04-23T00:53:00.000Z","size":67,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T15:44:40.376Z","etag":null,"topics":["ansi","cli","console","javascript","nodejs","scrolling","terminal-ui","typescript"],"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/pawap90.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":"2023-07-15T23:36:40.000Z","updated_at":"2024-09-05T18:55:01.000Z","dependencies_parsed_at":"2024-04-23T01:30:49.849Z","dependency_job_id":"49c64ca9-f632-4832-97c1-61f4599e54a5","html_url":"https://github.com/pawap90/scrollable-cli","commit_stats":null,"previous_names":["pawap90/scrollable-cli"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pawap90/scrollable-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawap90%2Fscrollable-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawap90%2Fscrollable-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawap90%2Fscrollable-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawap90%2Fscrollable-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pawap90","download_url":"https://codeload.github.com/pawap90/scrollable-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawap90%2Fscrollable-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274146061,"owners_count":25230114,"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-09-08T02:00:09.813Z","response_time":121,"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":["ansi","cli","console","javascript","nodejs","scrolling","terminal-ui","typescript"],"created_at":"2024-11-12T23:14:59.629Z","updated_at":"2025-11-03T17:38:55.393Z","avatar_url":"https://github.com/pawap90.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://img.shields.io/npm/v/scrollable-cli.svg)](https://www.npmjs.com/package/scrollable-cli) [![ci](https://github.com/pawap90/scrollable-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/pawap90/scrollable-cli/actions/workflows/ci.yml)\n\nCreate independent scrollable areas with ANSI support in the terminal.\n\n![3 scrollable areas controller by the arrow keys](https://github.com/pawap90/scrollable-cli/assets/2507959/c9f34db9-65b0-4629-8ebc-cd840f729c21)\n\n\n## Install\n\n```sh\nnpm install scrollable-cli\n```\n\n## Usage\n\nCreate a scrollable area with content and print it:\n\n```ts\nimport Scrollable from 'scrollable-cli';\n\nconst box = Scrollable({\n    content:\n        \"Lorem ipsum is boring but I couldn't think \" +\n        \"of anything else, so here's a yellow cat:\" +\n        chalk.yellow(`\n        |\\\\---/|\n        | o_o |\n        `),\n    start: { x: 10, y: 3 },\n    size: { width: 22, height: 4 },\n    wrapOptions: { trim: false, hard: false, wordWrap: true }\n})\n.print();\n```\n\nOr use the fluent API:\n\n```ts\nconst box = Scrollable()\n    .setContent(\"...\")\n    .setStart({ x: 10, y: 3 })\n    .setSize({ width: 22, height: 4 })\n    .setWrapOptions({ trim: false, hard: false, wordWrap: true })\n    .print();\n```\n\nScroll the content up and down:\n\n```ts\nbox.scroll(1).print(); // Down\n\nbox.scroll(-1).print(); //Up\n```\n\n### Key press events\nThis package doesn't handle keypress events to make it easier for you to integrate it with your own keypress event handler: \n\n```ts\nconst box = Scrollable(/* ... */);\n\nemitKeypressEvents(process.stdin);\nprocess.stdin.setRawMode(true);\n\nprocess.stdin.on('keypress', (str, key) =\u003e {\n    switch (key.name) {\n    case 'up':\n        box.scroll(-1).print();\n        break;\n    case 'down':\n        box.scroll(1).print();\n        break;\n    }\n});\n```\n\n![a single scrollable area with text and ansi codes](https://github.com/pawap90/scrollable-cli/assets/2507959/db063b13-0777-428d-831c-73be5ba55fd0)\n\n## Examples\n\n1. Clone the repo:\n\n```sh\ngit clone https://github.com/pawap90/scrollable-cli.git\n```\n\n2. Install dependencies:\n\n```sh\nnpm install\n```\n\n3. Run the examples:\n\n```sh\nnpm run example --file=\u003cexample-file-name\u003e\n\n## Or for windows:\nnpm run example:win --file=\u003cexample-file-name\u003e\n\n## E.g:\nnpm run example --file=1-simple-box\n\nnpm run example:win --file=1-simple-box\n```\n\n| Example file | Description |\n| -------- | -------- |\n| [1-simple-box](/examples/1-simple-box.ts) | Prints a simple \"lorem ipsum\" box that scrolls automatically up and down. |\n| [2-keypress-events](/examples/2-keypress-events.ts) | Prints 3 independent boxes that can be scrolled up and down with the arrow keys. |\n\n## Test\n\n```sh\nnpm test\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawap90%2Fscrollable-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpawap90%2Fscrollable-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawap90%2Fscrollable-cli/lists"}