{"id":36811879,"url":"https://github.com/gowikel/ink-use-stream-dimensions","last_synced_at":"2026-01-12T13:49:58.989Z","repository":{"id":238877286,"uuid":"797820610","full_name":"gowikel/ink-use-stream-dimensions","owner":"gowikel","description":"React hook to get the columns and rows of a stream (likely stdout) in Ink","archived":false,"fork":false,"pushed_at":"2024-05-14T00:40:07.000Z","size":279,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T01:01:26.803Z","etag":null,"topics":["command-line","console","dimensions","ink","ink-hook","react","stdout","stdout-stream","stream","terminal"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gowikel.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,"publiccode":null,"codemeta":null}},"created_at":"2024-05-08T15:25:21.000Z","updated_at":"2024-05-14T00:40:10.000Z","dependencies_parsed_at":"2024-05-12T12:41:29.248Z","dependency_job_id":"c60bf20f-1716-406e-b069-407eb2cdc294","html_url":"https://github.com/gowikel/ink-use-stream-dimensions","commit_stats":null,"previous_names":["gowikel/use-stream-dimensions","gowikel/ink-use-stream-dimensions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gowikel/ink-use-stream-dimensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowikel%2Fink-use-stream-dimensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowikel%2Fink-use-stream-dimensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowikel%2Fink-use-stream-dimensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowikel%2Fink-use-stream-dimensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gowikel","download_url":"https://codeload.github.com/gowikel/ink-use-stream-dimensions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gowikel%2Fink-use-stream-dimensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28339527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["command-line","console","dimensions","ink","ink-hook","react","stdout","stdout-stream","stream","terminal"],"created_at":"2026-01-12T13:49:58.896Z","updated_at":"2026-01-12T13:49:58.979Z","avatar_url":"https://github.com/gowikel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ink-use-stream-dimensions\n\n\u003e React hook to get the columns and rows of a stream (likely stdout) in [Ink](https://github.com/vadimdemedes/ink)\n\nThis library is ESM compatible.\n\n## Install\n\n```\nnpm install ink-use-stream-dimensions\n```\n\n## API\n\n### `useStreamDimensions(stdout: ConsoleStream): [number, number]`\n\n`ConsoleStream` is any type that contais:\n\n- rows as a `number`\n- columns as a `number`\n- on, handler with signature `(event: \"resize\", callback: () =\u003e void) =\u003e void`\n- off, handler with signature `(event: \"resize\", callback: () =\u003e void) =\u003e void`\n\n(`useStdout` returns the `stdout` object which already has that signature)\n\nIt returns the columns and rows, and subscribes to changes to them\n\n## Example\n\n\u003e :warning: This is my first published package. I am trying to make it compatible with ESM and CJS. If you find any\n\u003e issue importing the library, feel free to file a bug\n\n```javascript\nimport React from 'react'\nimport { Box, Text, useStdout } from \"ink\"\nimport { useStreamDimensions } from \"ink-use-stream-dimensions\"\n\n\nfunction MyApp() {\n   const { stdout } = useStdout()\n   const [columns, rows] = useStreamDimensions(stdout)\n\n   return (\n    \u003cBox\u003e\n      \u003cText\u003e\n        {columns}x{rows}\n      \u003c/Text\u003e\n    \u003c/Box\u003e\n   )\n}\n\nexport default MyApp\n```\n\n## License\n\nThis project is licensed under the Unlicense - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgowikel%2Fink-use-stream-dimensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgowikel%2Fink-use-stream-dimensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgowikel%2Fink-use-stream-dimensions/lists"}