{"id":24785621,"url":"https://github.com/dailybothq/search-text-highlight","last_synced_at":"2026-05-03T21:05:09.919Z","repository":{"id":35107697,"uuid":"207586685","full_name":"DailyBotHQ/search-text-highlight","owner":"DailyBotHQ","description":"This tool allow find a string or substring from a text and highlight it with html wrapper with unicode support.","archived":false,"fork":false,"pushed_at":"2025-10-07T20:04:37.000Z","size":770,"stargazers_count":16,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-07T22:08:53.530Z","etag":null,"topics":["highlight","html-wrapper","nodejs","search","text","unicode-support"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/search-text-highlight","language":"TypeScript","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/DailyBotHQ.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-09-10T14:49:04.000Z","updated_at":"2025-10-07T20:04:36.000Z","dependencies_parsed_at":"2023-01-15T13:58:27.518Z","dependency_job_id":"b973a75a-a467-4b9a-ba6b-ca0b8847843f","html_url":"https://github.com/DailyBotHQ/search-text-highlight","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.32499999999999996","last_synced_commit":"2fbe827507a0edc2321fbefc6ae9429bb44f1507"},"previous_names":["rockalabs/search-text-highlight"],"tags_count":127,"template":false,"template_full_name":null,"purl":"pkg:github/DailyBotHQ/search-text-highlight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DailyBotHQ%2Fsearch-text-highlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DailyBotHQ%2Fsearch-text-highlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DailyBotHQ%2Fsearch-text-highlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DailyBotHQ%2Fsearch-text-highlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DailyBotHQ","download_url":"https://codeload.github.com/DailyBotHQ/search-text-highlight/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DailyBotHQ%2Fsearch-text-highlight/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010939,"owners_count":26084837,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["highlight","html-wrapper","nodejs","search","text","unicode-support"],"created_at":"2025-01-29T14:19:25.049Z","updated_at":"2026-05-03T21:05:09.361Z","avatar_url":"https://github.com/DailyBotHQ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Search Text Highlight\n\nThis tool lets you find a string or substring in text and highlight it with an HTML wrapper, with Unicode support.\n\n---\n\n[![GitHub license](https://img.shields.io/github/license/DailyBotHQ/search-text-highlight)](https://github.com/DailyBotHQ/search-text-highlight/blob/main/LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/DailyBotHQ/search-text-highlight)](https://github.com/DailyBotHQ/search-text-highlight)\n[![total downloads](https://img.shields.io/npm/dt/search-text-highlight.svg)](https://www.npmjs.com/package/search-text-highlight)\n\n## Installation\n\n```\nnpm install search-text-highlight --save\n\nor\n\nyarn add search-text-highlight\n```\n\n## Usage\n\nImport\n\n```javascript\n// ES6 import\n→ import searchTextHL from 'search-text-highlight'\n\nor\n\n// CommonJS require\n→ const searchTextHL = require('search-text-highlight')\n```\n\nBasic usage\n\n```javascript\n→ const text = 'This is a simple but an amazing tool for text highlight 😎.'\n→ const query = 'amazing'\n→ searchTextHL.highlight(text, query)\nThis is a simple but an \u003cspan class=\"text-highlight\"\u003eamazing\u003c/span\u003e tool for text highlight 😎.\n```\n\nHighlight multiple match substrings.\n\n```javascript\n→ const text = 'This is a simple but an amazing tool for text highlight 😎.'\n→ const query = 'a'\n→ searchTextHL.highlight(text, query)\nThis is \u003cspan class=\"text-highlight\"\u003ea\u003c/span\u003e simple but \u003cspan class=\"text-highlight\"\u003ea\u003c/span\u003en \u003cspan class=\"text-highlight\"\u003ea\u003c/span\u003em\u003cspan class=\"text-highlight\"\u003ea\u003c/span\u003ezing tool for text highlight 😎.\n```\n\nCustomize html tag; the default is a `span`.\n\n```javascript\n→ const text = 'This is a simple but an amazing tool for text highlight 😎.'\n→ const query = 'amazing'\n→ const options = { htmlTag: 'label' }\n→ searchTextHL.highlight(text, query, options)\nThis is a simple but an \u003clabel class=\"text-highlight\"\u003eamazing\u003c/label\u003e tool for text highlight 😎.\n```\n\nCustomize highlight class.\n\n```javascript\n→ const text = 'This is a simple but an amazing tool for text highlight 😎.'\n→ const query = 'amazing'\n→ const options = { htmlTag: 'label', hlClass: 'custom-class' }\n→ searchTextHL.highlight(text, query, options)\nThis is a simple but an \u003clabel class=\"custom-class\"\u003eamazing\u003c/label\u003e tool for text highlight 😎.\n```\n\nHighlight only the first query match.\n\n```javascript\n→ const text = 'This is a simple but an amazing tool for text highlight 😎.'\n→ const query = 'a'\n→ const options = { htmlTag: 'label', hlClass: 'custom-class', matchAll: false }\n→ searchTextHL.highlight(text, query, options)\nThis is \u003clabel class=\"custom-class\"\u003ea\u003c/label\u003e simple but an amazing tool for text highlight 😎.\n```\n\nHighlight with a case sensitive query\n\n```javascript\n→ const text = 'This is a simple but an amazing tool for text highlight 😎.'\n→ const query = 'AMAZING'\n→ const options = { caseSensitive: true }\n→ searchTextHL.highlight(text, query, options)\nThis is a simple but an amazing tool for text highlight 😎.\n```\n\n## All value params for `highlight` method\n\n| Name    | Type   | Default | Description                           |\n| :------ | :----- | :------ | :------------------------------------ |\n| text    | string | ''      | base message                          |\n| query   | string | ''      | substring for highlight in message    |\n| options | object | {}      | parameterizable options for highlight |\n\n### All properties of highlight `options`\n\n| Name          | Type    | Default          | Description                                                                            |\n| :------------ | :------ | :--------------- | :------------------------------------------------------------------------------------- |\n| htmlTag       | string  | 'span'           | custom highlight HTML Tag wrapper                                                      |\n| hlClass       | string  | 'text-highlight' | custom highlight class                                                                 |\n| matchAll      | boolean | true             | match all instances of the query in text message, not just one                         |\n| caseSensitive | boolean | false            | match query text distinguish between uppercase (capital) and lowercase (small) letters |\n\n### Css Styles\n\nUse these css styles in your html code to highlight the found text.\n\n```css\n:root {\n  --light-blue-color: #b1d9ff;\n  --dark-blue-color: #508fca;\n}\n\n.text-highlight {\n  background: var(--light-blue-color);\n  border-radius: 2px;\n  padding: 0 2px;\n  border: 1px solid var(--dark-blue-color);\n}\n```\n\n## :electric_plug: Powered by [DailyBot](https://www.dailybot.com?utm_source=dailybotopensource\u0026utm_medium=search-text-highlight)\n\nDailyBot is an [AI Assistant](https://www.dailybot.com/product/ai) powered by ChatGPT that takes chat and collaboration to the next level helping to automate: daily standups, team check-ins, surveys, kudos, virtual watercooler, 1:1 intros, motivation tracking, chatops and more. [Learn more](https://www.dailybot.com?utm_source=dailybotopensource\u0026utm_medium=search-text-highlight).\n\n## License\n\nSearch text highlight is [MIT licensed](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdailybothq%2Fsearch-text-highlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdailybothq%2Fsearch-text-highlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdailybothq%2Fsearch-text-highlight/lists"}