Create clickable hyperlinks in terminal output that work in supported terminals.
Terminal-link is a Node.js library that creates clickable hyperlinks in terminal output. It solves the problem of making URLs in command-line applications interactive by detecting terminal support and providing appropriate ANSI escape codes or fallback text. This enhances user experience by allowing direct clicking instead of manual URL copying.
Node.js developers building command-line interfaces, CLI tools, and terminal applications who want to improve user interaction with clickable links.
Developers choose terminal-link for its automatic terminal compatibility detection, elegant fallback handling, and simple API that requires minimal configuration compared to manually implementing ANSI escape codes and terminal detection logic.
Create clickable links in the terminal
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Checks terminal support for hyperlinks using a community-maintained list, eliminating manual compatibility logic. Evidence: README mentions isSupported properties and links to a gist for supported terminals.
Defaults to plain text URLs in unsupported terminals, ensuring cross-environment usability without extra code. Evidence: Default fallback prints text and URL with a space separator when unsupported.
Provides separate methods for stdout and stderr (terminalLink.stderr), allowing flexible integration with different output streams. Evidence: README documents terminalLink.stderr and its isSupported property.
Requires only text and URL parameters for link creation, with minimal configuration needed. Evidence: Usage example shows terminalLink('My Website', 'url') with no complex setup.
Focuses only on basic link creation and fallback behavior, lacking built-in features like URL validation or advanced styling integration. Evidence: Options are minimal, primarily for fallback override, as per the API documentation.
Depends on a community-maintained gist for terminal support, which might not be updated for all emulators or new versions. Evidence: README links to an external gist, indicating potential maintenance gaps.
Does not provide mechanisms for handling malformed URLs or edge cases in output, leaving error management to the user. Evidence: API documentation doesn't cover error handling for invalid inputs or runtime issues.