Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inDemoInstall

terminal-link

Package Overview
Dependencies
2
Maintainers
1
Versions
8
Issues
File Explorer

Advanced tools

terminal-link

Create clickable links in the terminal

    3.0.0latest
    Github

Version published
Maintainers
1
Weekly downloads
13,631,210
increased by7.32%

Weekly downloads

Readme

Source

Create clickable links in the terminal

Install

$ npm install terminal-link

Usage

import terminalLink from 'terminal-link'; const link = terminalLink('My Website', 'https://sindresorhus.com'); console.log(link);

API

terminalLink(text, url, options?)

Create a link for use in stdout.

Supported terminals.

For unsupported terminals, the link will be printed in parens after the text: My website (https://sindresorhus.com).

text

Type: string

Text to linkify.

url

Type: string

URL to link to.

options

Type: object

fallback

Type: Function | boolean

Override the default fallback. The function receives the text and url as parameters and is expected to return a string.

If set to false, the fallback will be disabled when a terminal is unsupported.

terminalLink.isSupported

Type: boolean

Check whether the terminal's stdout supports links.

Prefer just using the default fallback or the fallback option whenever possible.

terminalLink.stderr(text, url, options?)

Create a link for use in stdout.

Same arguments as terminalLink().

terminalLink.stderr.isSupported

Type: boolean

Check whether the terminal's stderr supports links.

Prefer just using the default fallback or the fallback option whenever possible.

  • terminal-link-cli - CLI for this module
  • ink-link - Link component for Ink
  • chalk - Terminal string styling done right

Keywords

FAQs

What is terminal-link?

Create clickable links in the terminal

Is terminal-link popular?

The npm package terminal-link receives a total of 13,085,826 weekly downloads. As such, terminal-link popularity was classified as popular.

Is terminal-link well maintained?

We found that terminal-link demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 18 Apr 2021

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[email protected]

Product

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc