{"id":30180559,"url":"https://github.com/sindresorhus/term-size","last_synced_at":"2025-08-12T08:01:54.718Z","repository":{"id":10971575,"uuid":"67813157","full_name":"sindresorhus/terminal-size","owner":"sindresorhus","description":"Reliably get the terminal window size","archived":false,"fork":false,"pushed_at":"2023-11-04T17:48:25.000Z","size":70,"stargazers_count":142,"open_issues_count":4,"forks_count":15,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-08-11T18:18:37.703Z","etag":null,"topics":[],"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/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2016-09-09T16:06:17.000Z","updated_at":"2025-06-25T19:33:31.000Z","dependencies_parsed_at":"2023-11-06T08:32:34.028Z","dependency_job_id":"10521a87-76bc-4405-a872-d8e4b150c83d","html_url":"https://github.com/sindresorhus/terminal-size","commit_stats":null,"previous_names":["sindresorhus/terminal-size","sindresorhus/term-size"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/sindresorhus/terminal-size","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fterminal-size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fterminal-size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fterminal-size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fterminal-size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/terminal-size/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fterminal-size/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270024697,"owners_count":24514054,"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-08-12T02:00:09.011Z","response_time":80,"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":[],"created_at":"2025-08-12T08:01:16.396Z","updated_at":"2025-08-12T08:01:54.705Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","readme":"# terminal-size\n\n\u003e Reliably get the terminal window size\n\nBecause [`process.stdout.columns`](https://nodejs.org/api/tty.html#tty_writestream_columns) doesn't exist when run [non-interactively](http://www.tldp.org/LDP/abs/html/intandnonint.html), for example, in a child process or when piped. This module even works when all the TTY file descriptors are redirected!\n\nConfirmed working on macOS, Linux, and Windows.\n\n## Install\n\n```sh\nnpm install terminal-size\n```\n\n## Usage\n\n```js\nimport terminalSize from 'terminal-size';\n\nterminalSize();\n//=\u003e {columns: 143, rows: 24}\n```\n\n## API\n\n### terminalSize()\n\nReturns an `object` with `columns` and `rows` properties.\n\n## Related\n\n- [terminal-size-cli](https://github.com/sindresorhus/terminal-size-cli) - CLI for this module\n","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","Packages","命令行","包","Command-line utilities","目录"],"sub_categories":["Command-line utilities","命令行工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fterm-size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fterm-size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fterm-size/lists"}