
Security News
Critical Security Vulnerability in React Server Components
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.
@orama/highlight
Advanced tools
Highlight any text in any JavaScript lib (browser, server, React, Vue, you name it!)
Orama Highlight allows you to easily highlight substrings in a given input.
npm i @orama/highlight
bun i @orama/highlight
import { Highlight } from '@orama/highlight'
const inputString = 'The quick brown fox jumps over the lazy dog'
const toHighlight = 'brown fox jump'
const highlighter = new Highlight()
const highlighted = highlighter.highlight(inputString, toHighlight)
console.log(highlighted.positions)
// [
// {
// start: 10,
// end: 14
// }, {
// start: 16,
// end: 18
// }, {
// start: 20,
// end: 23
// }
// ]
console.log(highlighted.HTML)
// "The quick <mark class="orama-highlight">brown</mark> <mark class="orama-highlight">fox</mark> <mark class="orama-highlight">jump</mark>s over the lazy dog"
console.log(highlighted.trim(10))
// "...uick <mark class="orama-highlight">brown</mark>..."
You can always customize the library behavior by passing some options to the class constructor:
const highlighted = new Highlight({
caseSensitive: true, // Only highlight words that respect the second parameter's casing. Default is false
wholeWords: true, // Only highlight entire words, no prefixes
HTMLTag: 'div', // Default is "mark"
CSSClass: 'my-custom-class' // default is 'orama-highlight'
})
FAQs
Highlight any text in any JavaScript lib (browser, server, React, Vue, you name it!)
We found that @orama/highlight demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers 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.

Security News
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.

Security News
TypeScript 6.0 will be the last JavaScript-based major release, as the project shifts to the TypeScript 7 native toolchain with major build speedups.