source: frontend/node_modules/terminal-link/readme.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.8 KB
Line 
1# terminal-link [![Build Status](https://travis-ci.org/sindresorhus/terminal-link.svg?branch=master)](https://travis-ci.org/sindresorhus/terminal-link)
2
3> Create clickable links in the terminal
4
5<img src="screenshot.gif" width="301" height="148">
6
7## Install
8
9```
10$ npm install terminal-link
11```
12
13## Usage
14
15```js
16const terminalLink = require('terminal-link');
17
18const link = terminalLink('My Website', 'https://sindresorhus.com');
19console.log(link);
20```
21
22## API
23
24### terminalLink(text, url, options?)
25
26Create a link for use in stdout.
27
28[Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)
29
30For unsupported terminals, the link will be printed in parens after the text: `My website (https://sindresorhus.com)`.
31
32#### text
33
34Type: `string`
35
36Text to linkify.
37
38#### url
39
40Type: `string`
41
42URL to link to.
43
44#### options
45
46Type: `object`
47
48##### fallback
49
50Type: `Function | boolean`
51
52Override the default fallback. The function receives the `text` and `url` as parameters and is expected to return a string.
53
54If set to `false`, the fallback will be disabled when a terminal is unsupported.
55
56### terminalLink.isSupported
57
58Type: `boolean`
59
60Check whether the terminal's stdout supports links.
61
62Prefer just using the default fallback or the `fallback` option whenever possible.
63
64### terminalLink.stderr(text, url, options?)
65
66Create a link for use in stdout.
67
68Same arguments as `terminalLink()`.
69
70### terminalLink.stderr.isSupported
71
72Type: `boolean`
73
74Check whether the terminal's stderr supports links.
75
76Prefer just using the default fallback or the `fallback` option whenever possible.
77
78## Related
79
80- [terminal-link-cli](https://github.com/sindresorhus/terminal-link-cli) - CLI for this module
81- [ink-link](https://github.com/sindresorhus/ink-link) - Link component for Ink
82- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
Note: See TracBrowser for help on using the repository browser.