{"id":13396685,"url":"https://github.com/sindresorhus/terminal-link","last_synced_at":"2025-04-25T14:47:06.796Z","repository":{"id":43114557,"uuid":"128096799","full_name":"sindresorhus/terminal-link","owner":"sindresorhus","description":"Create clickable links in the terminal","archived":false,"fork":false,"pushed_at":"2025-03-25T19:11:46.000Z","size":419,"stargazers_count":629,"open_issues_count":1,"forks_count":25,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-19T10:06:46.283Z","etag":null,"topics":["command-line","hyperlink","hyperlink-support","nodejs","npm-package","terminal"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2018-04-04T17:28:48.000Z","updated_at":"2025-04-15T21:47:34.000Z","dependencies_parsed_at":"2023-09-27T09:48:47.356Z","dependency_job_id":"abd21d91-30d9-4e51-89be-29de9b16469c","html_url":"https://github.com/sindresorhus/terminal-link","commit_stats":{"total_commits":25,"total_committers":9,"mean_commits":"2.7777777777777777","dds":0.36,"last_synced_commit":"a7b0fda280a150cfe5f966b02bf8a21ff6fa82ea"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fterminal-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fterminal-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fterminal-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fterminal-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/terminal-link/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250561131,"owners_count":21450353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","hyperlink","hyperlink-support","nodejs","npm-package","terminal"],"created_at":"2024-07-30T18:01:00.090Z","updated_at":"2025-04-24T04:21:34.696Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["打印","Packages","JavaScript","Repository","包","CLI apps development","Output","Command-line utilities","目录","Uncategorized"],"sub_categories":["Command-line utilities","Command-line Utilities","命令行工具","Shell","Uncategorized","命令行实用工具"],"readme":"# terminal-link\n\n\u003e Create clickable links in the terminal\n\n\u003cimg src=\"screenshot.gif\" width=\"301\" height=\"148\"\u003e\n\n## Install\n\n```sh\nnpm install terminal-link\n```\n\n## Usage\n\n```js\nimport terminalLink from 'terminal-link';\n\nconst link = terminalLink('My Website', 'https://sindresorhus.com');\nconsole.log(link);\n```\n\n## API\n\n### terminalLink(text, url, options?)\n\nCreate a link for use in stdout.\n\n[Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)\n\nFor unsupported terminals, the link will be printed in parens after the text: `My website (https://sindresorhus.com)`.\n\n#### text\n\nType: `string`\n\nText to linkify.\n\n#### url\n\nType: `string`\n\nURL to link to.\n\n#### options\n\nType: `object`\n\n##### fallback\n\nType: `Function | boolean`\n\nOverride the default fallback. The function receives the `text` and `url` as parameters and is expected to return a string.\n\nIf set to `false`, the fallback will be disabled when a terminal is unsupported.\n\n### terminalLink.isSupported\n\nType: `boolean`\n\nCheck whether the terminal's stdout supports links.\n\nPrefer just using the default fallback or the `fallback` option whenever possible.\n\n### terminalLink.stderr(text, url, options?)\n\nCreate a link for use in stderr.\n\nSame arguments as `terminalLink()`.\n\n### terminalLink.stderr.isSupported\n\nType: `boolean`\n\nCheck whether the terminal's stderr supports links.\n\nPrefer just using the default fallback or the `fallback` option whenever possible.\n\n## Related\n\n- [terminal-link-cli](https://github.com/sindresorhus/terminal-link-cli) - CLI for this module\n- [ink-link](https://github.com/sindresorhus/ink-link) - Link component for Ink\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fterminal-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fterminal-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fterminal-link/lists"}