cli-hyperlinks
TypeScript icon, indicating that this package has built-in type declarations

0.2.6 • Public • Published

cli-hyperlinks

Creates hyperlink like URLs in your CLI

Usage

import * as hyperlinks from 'cli-hyperlinks';

async function main() {
  await hyperlinks.enableHyperlinks();

  console.log(`Learn more about ${hyperlinks.a("https://de.wikipedia.org/wiki/Hyperlink", "Hyperlinks")}!`);
}

As long as the application is running you can use the hyperlinks rendered by the cli application:

Api

enableHyperlinks

enableHyperLinks: () => Promise

Enables the rendering of hyperlinks and launches a proxy that forwards the hyperlinks to the original urls.

Note that this also keeps the cli open!

hyperlink (Alias: a)

hyperlink(url: string, text: string): Hyperlink

Renders a hyperlink, that can be used in your cli:

console.log(hyperlink("http://exmaple.com", "Link"))

Creates an object with a .toString method that prints an url, pointing to a proxy, which redirects to the original hyperlinked url.

Readme

Keywords

Package Sidebar

Install

npm i cli-hyperlinks

Weekly Downloads

7

Version

0.2.6

License

ISC

Unpacked Size

33.5 kB

Total Files

16

Last publish

Collaborators

  • pbedat