3.0.0 • Published 3 years ago

terminal-link v3.0.0

Weekly downloads
6,958,543
License
MIT
Repository
github
Last release
3 years ago

terminal-link

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.

Related

@xdn/nuxt@prisma/get-platform@prisma/internals@prisma/sdk@ismay/morpheus-cli@knzn/git@edgio/nuxt@edgio/clicreate-redwood-app@auto-canary/autoauto@redwoodjs/cli@redwoodjs/auth-dbauth-setup@redwoodjs/internal@layer0/nuxt@layer0/clieasy-select-rnnative-stream-wa-automateinit-log4brainsreact-native-bluetooth2testing-cli-ajayspecify-importsbabel-specify-importsdelay-watch@snuffish/delay-watchsnyk-preventhsesgraphql-fragment-importreact-native-template-rfbaseairscanairscan-example@pistazie/grvzreact-native-esc-pos-sahaab@borisovart/atol-kkt-modulephill@mayahq/wabornslatydeneme323112rozmie@evangodon/lrgbrlmngr@huamiao-cli/utilsjulong_cmdpokecli-archpokeran-cli@ntt_app/react-native-custom-notificationwrm-troubleshooting-poc@spherehq/cligenerator-conacytreact-native-covid-sdkgql_din_modbitgetnodeltsavrorajs@avrora/engine@wearerequired/wordpress-plugin-boilerplatezeslint@45air/air-local-docker@olivervorasai/sliderreact-native-printer-brothersweapp-template-cli@accessibility-tools/cicreate-itoa-5-app@amar-cli-dev/utilsreact-native-shekhar-bridge-testcogoportutilsfa-builderwilscanner@byted-starry/cli@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-testcreate-sarys-app@softstone/cli-git@goku-gaga/node-ltsnonametxt@joyui/node-cli-toolboxplginexpand-react-bridgef3elintrlintnetlify-cliluminos-ui-corehifindersklif-ui-kitsklif-api@everything-registry/sub-chunk-2891jawwy-sdkjawwy_gamification_releasespeed-lintreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkg@dragon-slayer-dev/git@itoa/app-graphql-playground@itoa/itoa@itoa/keystone@dragon-slayer/gitfe-encode-lint
3.0.0

3 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.0

6 years ago