{"id":13447333,"url":"https://github.com/danieldelcore/hyper-match","last_synced_at":"2025-03-21T17:31:15.736Z","repository":{"id":57270011,"uuid":"105519646","full_name":"danieldelcore/hyper-match","owner":"danieldelcore","description":"HyperTerm extension which matches regular expressions with predefined commands ","archived":true,"fork":false,"pushed_at":"2018-05-03T04:35:16.000Z","size":362,"stargazers_count":16,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T03:34:26.795Z","etag":null,"topics":["hyper","hyperlinks","hyperterm","plugin","regex","trigger"],"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/danieldelcore.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":null,"support":null}},"created_at":"2017-10-02T09:50:14.000Z","updated_at":"2024-12-25T12:17:20.000Z","dependencies_parsed_at":"2022-08-25T05:10:25.499Z","dependency_job_id":null,"html_url":"https://github.com/danieldelcore/hyper-match","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldelcore%2Fhyper-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldelcore%2Fhyper-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldelcore%2Fhyper-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldelcore%2Fhyper-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danieldelcore","download_url":"https://codeload.github.com/danieldelcore/hyper-match/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244838151,"owners_count":20518797,"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":["hyper","hyperlinks","hyperterm","plugin","regex","trigger"],"created_at":"2024-07-31T05:01:14.571Z","updated_at":"2025-03-21T17:31:15.396Z","avatar_url":"https://github.com/danieldelcore.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Hyper Match\n\n## WARNING: THIS PROJECT IS DEPRECATED\nHyper v2 now uses [xterm.js](https://github.com/xtermjs/xterm.js) which supports link detection out of the box.\n\n[![Mentioned in Awesome Hyper](https://awesome.re/mentioned-badge.svg)](https://github.com/bnb/awesome-hyper)\n[![npm](https://img.shields.io/npm/dm/hyper-match.svg?label=DL)](https://www.npmjs.com/package/hyper-match)\n\nAn extension for [Hyper](https://hyper.is) that binds commands to patterns detected in the terminal. When a pattern is detected, it is rendered as a hyperlink which will execute your command on click. \n\nPatterns such as urls, email addresses and file paths can be configured to do anything when clicked, for example: open a browser, email client, or file manager. \n\nInspired by [iterm's Triggers](https://www.iterm2.com/documentation-triggers.html).\nBased on [hyperlinks](https://github.com/zeit/hyperlinks).\n\n![Demo](assets/demo.gif)\n\n## Usage\n\n[Install Hyper](https://hyper.is/#installation) and add `hyper-match` to `plugins` in `~/.hyper.js`.\n\n### Customizing styles\n\nAdd custom styles to `termCSS` in your `~/.hyper.js`.\n\n``` javascript\ntermCSS: `\n    x-screen a {\n        color: #ff2e88;\n        text-decoration: none;\n    }\n\n    x-screen a.hover {\n        text-decoration: underline;\n    }\n`\n```\n\n## Configuration\nA trigger has the following properties:\n- **name:** Unique identifier for a trigger\n- **pattern:** A regular expression\n- **strategy:** A command to be executed when a link is clicked. `hyper-match` uses [`.replace()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) under the hood to output parameters into the supplied strategy.\n    - `$\u0026`: Inserts the matched substring.\n    - `$`: Inserts the portion of the string that precedes the matched substring.\n    - `$'`: Inserts the portion of the string that follows the matched substring.\n    - `$n`: Where `n` is a positive integer less than 100, inserts the nth parenthesized submatch string, provided the first argument was a RegExp object. Note that this is 1-indexed.\n- **options:** Regular expression options\n- **priority:** Defines the weight of a pattern and is used if the pattern conflicts with another\n- **linkColor:** A CSS color\n\n**Example:**\n\n``` javascript\nmodule.exports = {\n  ...\n  config: {\n    ...\n    'hyper-match': {\n        triggers: [\n            {\n                name: 'date',\n                pattern: '^(0[1-9]|1[0-2])[\\\\/](0[1-9]|[12]\\\\d|3[01])[\\\\/](19|20)\\\\d{2}$',\n                options: 'g',\n                strategy: 'echo \\'$\u0026\\' | pbcopy \u0026\u0026 open \"https://calendar.google.com\"',\n                priority: 1,\n                linkColor: '#4285f4',\n            },\n            {\n                name: 'email',\n                pattern: '[a-z0-9]+[_a-z0-9\\\\.-]*[a-z0-9]+@[a-z0-9-]+(\\\\.[a-z0-9-]+)*(\\\\.[a-z]{2,4})',\n                options: 'gi',\n                strategy: 'echo \\'$\u0026\\' | pbcopy \u0026\u0026 open \"https://mail.google.com\"',\n                priority: 2,\n            },\n            {\n                name: 'css-color',\n                pattern: '#(?:[a-f\\\\d]{3}){1,2}\\\\b|rgb\\\\((?:(?:\\\\s*0*(?:25[0-5]|2[0-4]\\\\d|1?\\\\d?\\\\d)\\\\s*,){2}\\\\s*0*(?:25[0-5]|2[0-4]\\\\d|1?\\\\d?\\\\d)|\\\\s*0*(?:100(?:\\\\.0+)?|\\\\d?\\\\d(?:\\\\.\\\\d+)?)%(?:\\\\s*,\\\\s*0*(?:100(?:\\\\.0+)?|\\\\d?\\\\d(?:\\\\.\\\\d+)?)%){2})\\\\s*\\\\)|hsl\\\\(\\\\s*0*(?:360|3[0-5]\\\\d|[12]?\\\\d?\\\\d)\\\\s*(?:,\\\\s*0*(?:100(?:\\\\.0+)?|\\\\d?\\\\d(?:\\\\.\\\\d+)?)%\\\\s*){2}\\\\)|(?:rgba\\\\((?:(?:\\\\s*0*(?:25[0-5]|2[0-4]\\\\d|1?\\\\d?\\\\d)\\\\s*,){3}|(?:\\\\s*0*(?:100(?:\\\\.0+)?|\\\\d?\\\\d(?:\\\\.\\\\d+)?)%\\\\s*,){3})|hsla\\\\(\\\\s*0*(?:360|3[0-5]\\\\d|[12]?\\\\d?\\\\d)\\\\s*(?:,\\\\s*0*(?:100(?:\\\\.0+)?|\\\\d?\\\\d(?:\\\\.\\\\d+)?)%\\\\s*){2},)\\\\s*0*(?:1|0(?:\\\\.\\\\d+)?)\\\\s*\\\\)',\n                options: 'gi',\n                strategy: 'echo \\'$\u0026\\' | pbcopy',\n                priority: 1,\n            },\n        ]\n    }\n    ...\n  }\n  ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldelcore%2Fhyper-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieldelcore%2Fhyper-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldelcore%2Fhyper-match/lists"}