highlight-words-core is a foundational utility library that provides core logic for identifying and segmenting matching words within a larger text string. It serves as the headless engine for UI components like `react-highlight-words` and `react-native-highlight-words`, abstracting away the text processing logic. The current stable version is 1.2.3. As a low-level utility, its release cadence is infrequent, primarily receiving updates for critical bug fixes or performance enhancements rather than new features. Its key differentiator is its framework-agnostic nature, allowing developers to implement custom rendering logic on top of its chunking output, making it versatile for various highlighting applications beyond specific UI frameworks.
npm install highlight-words-coreVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use `findAll` to process text and produce HTML with highlighted matches, including options for `autoEscape` and `caseSensitive`.
Pass `autoEscape: true` to the `findAll` function options: `findAll({ searchWords, textToHighlight, autoEscape: true })`.Set `caseSensitive: true` in the `findAll` function options: `findAll({ searchWords, textToHighlight, caseSensitive: true })`.Install TypeScript types: `npm install --save-dev @types/highlight-words-core` in addition to `npm install highlight-words-core`.
Ensure `autoEscape: true` is passed to `findAll` when `searchWords` are dynamically generated or come from user input.
Verify that `searchWords` contains the correct terms. If exact case matches are needed, set `caseSensitive: true` in the `findAll` options.
No dependency data recorded yet.