{"id":17817973,"url":"https://github.com/kjirou/tilto","last_synced_at":"2025-03-18T04:30:41.799Z","repository":{"id":47452220,"uuid":"101559301","full_name":"kjirou/tilto","owner":"kjirou","description":"A TUI (Text User Interface) renderer","archived":false,"fork":false,"pushed_at":"2021-08-31T07:28:46.000Z","size":237,"stargazers_count":17,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T03:34:03.867Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tilto","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/kjirou.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":"2017-08-27T14:51:03.000Z","updated_at":"2019-04-06T04:13:39.000Z","dependencies_parsed_at":"2022-08-23T17:50:16.785Z","dependency_job_id":null,"html_url":"https://github.com/kjirou/tilto","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/kjirou%2Ftilto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjirou%2Ftilto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjirou%2Ftilto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjirou%2Ftilto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kjirou","download_url":"https://codeload.github.com/kjirou/tilto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243713415,"owners_count":20335567,"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":[],"created_at":"2024-10-27T16:47:00.185Z","updated_at":"2025-03-18T04:30:41.316Z","avatar_url":"https://github.com/kjirou.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tilto\n\n[![Build Status](https://travis-ci.org/kjirou/tilto.svg?branch=master)](https://travis-ci.org/kjirou/tilto)\n\nA TUI (Text User Interface) renderer\n\n\n## :rocket: Installation\n\n```bash\nnpm install tilto\n```\n\n\n## :eyes: Overview\n\n```js\nconst tilto = require('tilto');\n\nconst box = tilto.createBox({width: 20, height: 6});\n\nbox.borders = tilto.createBordersByType('default');\nbox.content = 'The quick brown fox jumps over the lazy dog.';\nconsole.log(tilto.render(box));\n\nconst ansiRed = '\\u001b[31m';\nconst ansiGreen = '\\u001b[32m';\nconst ansiReset = '\\u001b[0m';\nbox.content = 'It also supports マルチバイト文字, Surrogate-pairs and ' +\n  `${ansiRed}ANSI${ansiReset} ${ansiGreen}escape${ansiReset} codes.`;\nconsole.log(tilto.render(box));\n\nbox.content = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'].join('\\n');\nbox.scroll = {\n  y: 4,\n};\nconsole.log(tilto.render(box));\n```\n\n:point_down:\n\n![](/documents/overview-output.png)\n\nSee also [examples](/examples).\n\n\n## :page_facing_up: About Basic Design\n\nThe `render` method receives a syntax tree expressed by pure-object and converts it to a rectangular string.\n\nYou can change the output by modifying the arguments according to the schema.\nAlso, [some utilities for that are defined as public API](/src/index.ts).\n\nIn this case, it is recommended to use a library that can safely update objects such as [immer](https://github.com/mweststrate/immer).\n\nThe schema of that is the following image if it is expressed by TypeScript.\nIf you want to know more about schema, please refer to the source code.\n\n```ts\ntype Box = {\n  borders: Borders;\n  children: Box[];\n  content: string,\n  matrix: Matrix,\n  scroll?: {\n    thumbElement?: ElementBody,\n    trackElement?: ElementBody,\n    y: number,\n  },\n  symbolRuler: SymbolRuler,\n  x: number,\n  y: number,\n  zIndex: number,\n};\n```\n\n\n## :wrench: Development\n### Softwares that needs to be locally installed\n\n- [Node.js](https://nodejs.org/) `== 10`\n\n### Install this application\n\n```bash\ngit clone git@github.com:kjirou/tit.git\ncd ./tilto\nnpm install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjirou%2Ftilto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkjirou%2Ftilto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjirou%2Ftilto/lists"}