UNPKG

@stacksjs/cli

Version:

TypeScript framework for CLI artisans. Build beautiful console apps with ease.

17 lines (12 loc) 517 B
import prompts from 'prompts'; import { log } from '@stacksjs/logging'; export { log, prompts } export default function terminalLink(text: string, url: string, { target = 'stdout', ...options }: { target?: string, fallback?: boolean | Function }): string { if (!supportsHyperlinks[target]) { if (options.fallback === false) { return text } return typeof options.fallback === 'function' ? options.fallback(text, url) : `${text} (\u200B${url}\u200B)` } return ansiEscapes.link(text, url) };