
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-fast-highlighter
Advanced tools
A performant react component to highlight fragement of text
Under the root folder of you project
npm i -S react-fast-highlighter
In your code where you want to highlight words in a piece of text
import Highlighter from 'react-fast-highlighter'
class MyComponent extends React.Component {
render() {
return (
<div>
<Highlighter
text="The first second was alright, but the second second was tough."
highlightText="second"
/>
</div>
)
}
}
The highlighted part would be wrapped in a mark tag, with highlighted classname.
You can customize the highlight style by adding some CSS:
.highlighted {
background-color: red;
}
{
/**
* The full text to display
* @default ""
*/
text: PropTypes.string,
/**
* The part of text that needs to be highlighted
* @default ""
*/
highlightText: PropTypes.string,
/**
* CSS class name applied to highlighted text
* @default "highlighted"
*/
highlightClassName: PropTypes.string,
/**
* Search should be case sensitive; defaults to false
* @default false
*/
caseSensitive: PropTypes.bool,
/**
* Type of tag to wrap around highlighted matches
* @default mark
*/
highlightTag: PropTypes.string,
/**
* Custom class name to use on outer span
* @default NULL
*/
className: PropTypes.string,
}
npm i
npm run storybook
localhost:6006 to see the componentThe CI is configured to publish a patch version for every commit on master. However, if you need to publish manually:
Build it first
npm run build
Incement the version number
npm version minor
Then publish
npm publish
FAQs
A react component to highlight words in a performant way
We found that react-fast-highlighter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.