Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
react-native-highlight-words
Advanced tools
A React Native port of react-highlight-words. This component is used to highlight words within a larger body of text.
React Native component used to highlight words within a larger body of text. This is a port of react-highlight-words.
Check out a demo using Exponent.
Using npm:
npm i --save react-native-highlight-words
To use it, just provide it with an array of search terms and a body of text to highlight:
import Highlighter from 'react-native-highlight-words';
<Highlighter
highlightStyle={{backgroundColor: 'yellow'}}
searchWords={['and', 'or', 'the']}
textToHighlight='The dog is chasing the cat. Or perhaps they're just playing?'
/>
And the Highlighter
component will highlight all occurrences of search terms within the text:
Property | Type | Required? | Description |
---|---|---|---|
autoEscape | Boolean | Escape characters which are meaningful in regular expressions | |
highlightStyle | Object | Styles applied to highlighted text | |
sanitize | Function | Process each search word and text to highlight before comparing (eg remove accents); signature (text: string): string | |
searchWords | Array | ✓ | Array of search words |
style | Object | Styles applied to the text wrapper | |
textToHighlight | String | ✓ | Text to highlight matches in |
MIT License - fork, modify and use however you want.
FAQs
A React Native port of react-highlight-words. This component is used to highlight words within a larger body of text.
The npm package react-native-highlight-words receives a total of 2,180 weekly downloads. As such, react-native-highlight-words popularity was classified as popular.
We found that react-native-highlight-words demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.