JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q26926F
  • License ISC

Create hyperlink like URLs in your CLI

Package Exports

  • cli-hyperlinks

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cli-hyperlinks) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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: () => 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(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.