{"id":13542581,"url":"https://github.com/sindresorhus/is-interactive","last_synced_at":"2025-04-12T17:38:46.090Z","repository":{"id":55419999,"uuid":"195558107","full_name":"sindresorhus/is-interactive","owner":"sindresorhus","description":"Check if stdout or stderr is interactive","archived":false,"fork":false,"pushed_at":"2023-11-06T21:14:27.000Z","size":10,"stargazers_count":116,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T22:56:38.197Z","etag":null,"topics":["interactive-shell","nodejs","npm-package","stdout","stdout-stream","terminal","tty"],"latest_commit_sha":null,"homepage":"","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":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2019-07-06T16:02:46.000Z","updated_at":"2025-01-07T20:11:38.000Z","dependencies_parsed_at":"2022-08-15T00:00:25.360Z","dependency_job_id":"50612330-6365-4022-869f-11645654a0d4","html_url":"https://github.com/sindresorhus/is-interactive","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":"0.19999999999999996","last_synced_commit":"9f714de0f5fd43ced5abdaafa4097a2562066e86"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-interactive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-interactive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-interactive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fis-interactive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/is-interactive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248358606,"owners_count":21090406,"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":["interactive-shell","nodejs","npm-package","stdout","stdout-stream","terminal","tty"],"created_at":"2024-08-01T10:01:11.649Z","updated_at":"2025-04-12T17:38:46.068Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","readme":"# is-interactive\n\n\u003e Check if stdout or stderr is [interactive](https://unix.stackexchange.com/a/43389/7678)\n\nIt checks that the stream is [TTY](https://jameshfisher.com/2017/12/09/what-is-a-tty/), not a dumb terminal, and not running in a CI.\n\nThis can be useful to decide whether to present interactive UI or animations in the terminal.\n\n## Install\n\n```sh\nnpm install is-interactive\n```\n\n## Usage\n\n```js\nimport isInteractive from 'is-interactive';\n\nisInteractive();\n//=\u003e true\n```\n\n## API\n\n### isInteractive(options?)\n\n#### options\n\nType: `object`\n\n##### stream\n\nType: [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable)\\\nDefault: [`process.stdout`](https://nodejs.org/api/process.html#process_process_stdout)\n\nThe stream to check.\n\n## FAQ\n\n#### Why are you not using [`ci-info`](https://github.com/watson/ci-info) for the CI check?\n\nIt's silly to have to detect individual CIs. They should identify themselves with the `CI` environment variable, and most do just that. A manually maintained list of detections will easily get out of date. And if a package using `ci-info` doesn't update to the latest version all the time, they will not support certain CIs. It also creates unpredictability as you might assume a CI is not supported and then suddenly it gets supported and you didn't account for that. In addition, some of the manual detections are loose and might cause false-positives which could create hard-to-debug bugs.\n\n#### Why does this even exist? It's just a few lines.\n\nIt's not about the number of lines, but rather discoverability and documentation. A lot of people wouldn't even know they need this. Feel free to copy-paste the code if you don't want the dependency. You might also want to read [this blog post](https://sindresorhus.com/blog/small-focused-modules).\n\n## Related\n\n- [is-in-ci](https://github.com/sindresorhus/is-in-ci) - Check if the process is running in a Continuous Integration (CI) environment\n- [is-unicode-supported](https://github.com/sindresorhus/is-unicode-supported) - Detect whether the terminal supports Unicode\n- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color\n","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","terminal"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fis-interactive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fis-interactive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fis-interactive/lists"}