Highlight Words Parser
Features
Parse a give string to highlight words.
Installation
yarn add highlight-words-parser
or
npm i highlight-words-parser --save
Usage
const highlightWords = console // Output://// [ { color: 'red', value: 'Error' },// { value: ': this is a ' },// { color: 'green', value: '"test"' },// { value: ' message ' },// { color: 'green', value: '(from somewind)' } ]
You can use the result to render with React
or other.