
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
terminal-link
Advanced tools
The terminal-link npm package allows you to create clickable links in the terminal. This can be useful for providing users with easy access to URLs directly from the command line.
Basic Link Creation
This feature allows you to create a basic clickable link in the terminal. The link text ('My Website') will be clickable and will direct the user to the specified URL ('https://example.com').
const terminalLink = require('terminal-link');
const link = terminalLink('My Website', 'https://example.com');
console.log(link);
Conditional Link Creation
This feature allows you to create a link that only becomes clickable if the terminal supports it. If not, it will fall back to a plain text URL.
const terminalLink = require('terminal-link');
const link = terminalLink.isSupported ? terminalLink('My Website', 'https://example.com') : 'My Website (https://example.com)';
console.log(link);
Customizing Link Styles
This feature allows you to customize the appearance of the link text using other libraries like chalk. In this example, the link text is styled to be blue and underlined.
const terminalLink = require('terminal-link');
const chalk = require('chalk');
const link = terminalLink(chalk.blue.underline('My Website'), 'https://example.com');
console.log(link);
The ink-link package is used within the Ink framework to create clickable links in React-based terminal applications. It offers similar functionality to terminal-link but is designed to work seamlessly with Ink's component-based architecture.
Create clickable links in the terminal
npm install terminal-link
import terminalLink from 'terminal-link';
const link = terminalLink('My Website', 'https://sindresorhus.com');
console.log(link);
Create a link for use in stdout.
For unsupported terminals, by default the link will be printed as plain text with a space separator: My website https://sindresorhus.com
.
Type: string
Text to linkify.
Type: string
URL to link to.
Type: object
Type: function | boolean
Override the default fallback. The function receives the text
and url
as parameters and is expected to return a string.
If set to false
, the text
will be returned as-is when a terminal is unsupported.
Type: boolean
Check whether the terminal's stdout supports links.
Prefer just using the default fallback or the fallback
option whenever possible.
Create a link for use in stderr.
Same arguments as terminalLink()
.
Type: boolean
Check whether the terminal's stderr supports links.
Prefer just using the default fallback or the fallback
option whenever possible.
FAQs
Create clickable links in the terminal
The npm package terminal-link receives a total of 9,249,560 weekly downloads. As such, terminal-link popularity was classified as popular.
We found that terminal-link demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.