Create clickable links in the terminal
Switch branches/tags
Nothing to show
Clone or download
Latest commit a67125c Apr 20, 2018
Permalink
Failed to load latest commit information.
.editorconfig Init Apr 4, 2018
.gitattributes Init Apr 4, 2018
.gitignore Init Apr 4, 2018
.npmrc Init Apr 4, 2018
.travis.yml Init Apr 4, 2018
index.js Add `.isSupported` property Apr 4, 2018
license Init Apr 4, 2018
package.json 1.1.0 Apr 20, 2018
readme.md Add `.isSupported` property Apr 4, 2018
screenshot.gif Init Apr 4, 2018
test.js Add `.isSupported` property Apr 4, 2018

readme.md

terminal-link Build Status

Create clickable links in the terminal

Install

$ npm install terminal-link

Usage

const terminalLink = require('terminal-link');

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

API

terminalLink(text, url, [options])

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

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

terminalLink.isSupported

Type: boolean

Check whether the terminal support links.

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

Related

License

MIT © Sindre Sorhus