@jsvision/core / hyperlink
Function: hyperlink()
hyperlink(
text,url,caps):string
Defined in: render/osc.ts:37
Emit an OSC 8 hyperlink wrapping text with url. When the terminal lacks hyperlink support, returns the sanitized text as plain text (so it still reads correctly, just without the clickable link).
Parameters
text
string
Visible link text (sanitized).
url
string
Target URL (sanitized).
caps
Resolved terminal capabilities.
Returns
string
The ANSI string to write to the terminal.
Example
ts
import { hyperlink, resolveCapabilities } from '@jsvision/core';
const caps = resolveCapabilities().profile;
process.stdout.write(hyperlink('jsvision docs', 'https://example.com', caps));