# supports-hyperlinks

> Detect whether a terminal supports hyperlinks

Latest version **4.5.0** (published 2026-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install supports-hyperlinks
pnpm add supports-hyperlinks
yarn add supports-hyperlinks
bun add supports-hyperlinks
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.5.0 |
| Published | 2026-06-19 |
| First published | 2017-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 2 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Maintainers | sindresorhus |
| Keywords | link, terminal, hyperlink, cli, detect, check, ansi, escapes, console |

## Links

- npm: https://www.npmjs.com/package/supports-hyperlinks
- Repository: https://github.com/chalk/supports-hyperlinks
- Homepage: https://github.com/chalk/supports-hyperlinks#readme
- Issues: https://github.com/chalk/supports-hyperlinks/issues
- Funding: https://github.com/chalk/supports-hyperlinks?sponsor=1
- npm.io page: https://npm.io/package/supports-hyperlinks

## Dependencies (2)

- [has-flag](https://npm.io/package/has-flag.md) ^5.0.1
- [supports-color](https://npm.io/package/supports-color.md) ^10.2.2

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 4.5.0 (latest) — 2026-06-19
- 4.4.0 — 2025-12-25
- 4.3.0 — 2025-09-20
- 4.2.0 — 2025-09-16
- 4.1.2 — 2025-09-08
- 4.1.0 — 2025-05-10
- 4.0.0 — 2025-04-01
- 3.2.0 — 2025-02-02
- 3.1.0 — 2024-08-20
- 3.0.0 — 2023-03-08
- 2.3.0 — 2022-09-06
- 2.2.0 — 2021-04-06
- 2.1.0 — 2020-02-07
- 2.0.0 — 2019-07-17
- 1.0.1 — 2017-11-28
- … 1 more at https://npm.io/package/supports-hyperlinks/versions

## README

# supports-hyperlinks

> Detect whether a terminal supports hyperlinks

Terminal emulators are [starting to support hyperlinks](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). While many terminals have long detected URL's and linkified them, allowing you to Command-Click or Control-Click them to open a browser, you were forced to print the long unsightly URL's on the screen. As of spring 2017 [a few terminals](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) began supporting HTML like links, where the link text and destination could be specified separately.

This module allows you to detect if hyperlinks are supported in the current Terminal.

As this is a new development, we anticipate the list of supported terminals to grow rapidly. Please open an issue or submit a PR as new terminals implement support.

## Install

```sh
npm install supports-hyperlinks
```

## Usage

```js
import supportsHyperlinks from 'supports-hyperlinks';

if (supportsHyperlinks.stdout) {
	console.log('Terminal stdout supports hyperlinks');
}

if (supportsHyperlinks.stderr) {
	console.log('Terminal stderr supports hyperlinks');
}
```

## API

Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is a `boolean`, indicating whether or not hyperlinks are supported.

## Info

Obeys the `--no-hyperlinks`, `--hyperlink=always`, and `--hyperlink=never` CLI flags.

Can be overridden by the user with the flags `--hyperlinks=always` and `--no-hyperlinks`. For situations where using those flags are not possible, add the environment variable `FORCE_HYPERLINK=1` to forcefully enable hyperlinks or `FORCE_HYPERLINK=0` to forcefully disable. The use of `FORCE_HYPERLINK` overrides all other hyperlink support checks.

## Related

- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
- [supports-terminal-graphics](https://github.com/sindresorhus/supports-terminal-graphics) - Detect which terminal graphics protocols are supported

---
_Source: https://npm.io/package/supports-hyperlinks · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
