Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

supports-hyperlinks

Package Overview
Dependencies
2
Maintainers
3
Versions
6
Issues
File Explorer

Advanced tools

supports-hyperlinks

Detect if your terminal emulator supports hyperlinks

    2.3.0latest

Version published
Maintainers
3
Weekly downloads
17,672,768
increased by5.44%

Weekly downloads

Changelog

Source

  • Add VSCode support (#17) 45ff1a8
  • Add WezTerm support (#14) 6fda6c4
  • Fix Netlify support (#12) 579ca4c

https://github.com/jamestalmage/supports-hyperlinks/compare/v2.2.0...v2.3.0

Readme

Source

Detect whether a terminal emulator supports hyperlinks

Terminal emulators are starting to support hyperlinks. 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 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

$ npm install supports-hyperlinks

Usage

const supportsHyperlinks = require('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.

License

MIT © James Talmage

Keywords

FAQs

What is supports-hyperlinks?

Detect if your terminal emulator supports hyperlinks

Is supports-hyperlinks popular?

The npm package supports-hyperlinks receives a total of 14,836,856 weekly downloads. As such, supports-hyperlinks popularity was classified as popular.

Is supports-hyperlinks well maintained?

We found that supports-hyperlinks demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 3 open source maintainers collaborating on the project.

Last updated on 06 Sep 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc