{"name":"react-highlight-words","version":"0.19.0","description":"React component to highlight words within a larger body of text","main":"dist/main.js","scripts":{"build":"npm run build:website && npm run build:dist","build:website":"npm run clean:website && cross-env NODE_ENV=production webpack --config webpack.config.website.js -p --bail","build:dist":"npm run clean:dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.cjs.js --bail && cross-env NODE_ENV=production webpack --config webpack.config.dist.umd.js --bail","clean":"npm run clean:website && npm run clean:dist","clean:website":"rimraf build","clean:dist":"rimraf dist","deploy":"gh-pages -d build","lint":"standard","prebuild":"npm run lint","postpublish":"npm run deploy","start":"webpack-dev-server --hot --inline --config webpack.config.dev.js","test":"cross-env NODE_ENV=test karma start","watch":"watch 'clear && npm run lint -s && npm run test -s' src"},"repository":{"type":"git","url":"git+https://github.com/bvaughn/react-highlight-words.git"},"author":{"name":"Brian Vaughn"},"license":"MIT","bugs":{"url":"https://github.com/bvaughn/react-highlight-words/issues"},"homepage":"https://github.com/bvaughn/react-highlight-words#readme","keywords":["react","reactjs","react-component","highlighter","highlight","text","words","matches","substring","occurrences","search"],"standard":{"parser":"babel-eslint","ignore":["build","dist","node_modules"],"global":["afterAll","afterEach","beforeAll","beforeEach","describe","it","jasmine"]},"devDependencies":{"babel":"^5.8.34","babel-core":"^5.8.34","babel-eslint":"^4.1.6","babel-loader":"^5.4.0","babel-plugin-react-transform":"^1.1.1","cross-env":"^5.1.3","css-loader":"^0.23.0","cssnext":"^1.8.4","cssnext-loader":"^1.0.1","expect.js":"^0.3.1","gh-pages":"^0.8.0","html-webpack-plugin":"^1.7.0","karma":"^0.13.15","karma-junit-reporter":"^0.3.8","karma-mocha":"^0.2.1","karma-phantomjs2-launcher":"^0.3.2","karma-sourcemap-loader":"^0.3.6","karma-spec-reporter":"0.0.23","karma-webpack":"^1.7.0","latinize":"^0.2.0","lodash":"^4.17.10","mocha":"^2.3.4","phantomjs2":"^2.0.2","react":"^18.0.0","react-dom":"^18.0.0","react-transform-hmr":"^1.0.1","rimraf":"^2.4.4","standard":"^5.4.1","style-loader":"^0.13.0","watch":"^0.16.0","webpack":"^1.12.9","webpack-dev-server":"^1.14.0","worker-loader":"^0.7.0"},"dependencies":{"highlight-words-core":"^1.2.0","memoize-one":"^4.0.0","prop-types":"^15.5.8"},"peerDependencies":{"react":"^0.14.0 || ^15.0.0 || ^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0"},"gitHead":"eda4d6f6806cbbf55432d15a0f7d95ec0c0b1fdb","_id":"react-highlight-words@0.19.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-TBG/xIl5x1O5GHpNef/XYf3nQYIalac68xgh7jpKBecckz6ljlcASz2xCnZD8oIHf+b2lGG4J7B5bM8Zx2baeA==","shasum":"e32a3d247b6bc3659b7554e8fca74d11846613b9","tarball":"http://registry-npm.ywwl.com/react-highlight-words/download/react-highlight-words-0.19.0.tgz","fileCount":11,"unpackedSize":1601001,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHRxpQ+UZwn9eCClvqb6D2oPm2lacViYl6EUx36alY6jAiAfGhtiVmH7rdYE8xdfTDD7efqdaOnK/od66mKc9eK2Dw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjzbEbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNFBAAgOjdTW3zvXBMa+eHS5rxodOPDni+b0cCq64YG/j4GzrH0npr\r\nsbG13+rxz6pg9FjVtGc3GQpBI+hmO2A1BFd1KL9HsMNNUp/vGn3klI6bgRbF\r\nera5AVqM4PKOXwWb3/I+RjLb57QPLaWALx/YI1dAlN5xDhLwNL7o38fAb+yu\r\nYcqgyb/+E638pXUQNnOOaZvcMoAin+zsByfczl0BrrZCTOKd+iAUqImSQVb0\r\nk51eUnIB1J3FkRsXC6ImVBNA/lK9L7iCPcjCy3+tGTUH8NIVvu7tw4q0xqoT\r\n1HYqjTBwX1ppyd1jKyv8TD0M7VBIPN6VlympYrsdT0WQfmu9hubrHtc7WU8/\r\nS63OXoVLACY1cjXEaUsF5w+Yd5BbxJrHyRrGtA1q4sGnH3lLg3NEgKAInmQO\r\nkysleoRSqfGbCwJr9MK8mMr0tYtm4eB+/UuxujsN4igIfHSjZTt62cv4ATon\r\nf2poIaZhhYTuTbJrg+M6g2bE0OmNK25LJSH5dZESwbtiCldOkQUugdo4XRoA\r\noqvLpktx3KN/qrFLxs4rEbCZMajvng2pd/sm2PvSII+8mNfBz8brczO4iNeO\r\nyoVdyCDQtiqFUzwe3Ov+g4guR2H32txGY3RKVfKtJfj7J5ZpZwyMCyu/wks1\r\nlwy9P7qk3ud5uCklTA8vpmLShwCpFaVjLY8=\r\n=StLC\r\n-----END PGP SIGNATURE-----\r\n","size":445416,"noattachment":false,"key":"/react-highlight-words/-/react-highlight-words-0.19.0.tgz"},"_npmUser":{"name":"sergei-startsev","email":"ai@programist.ru"},"directories":{},"maintainers":[{"name":"brianvaughn","email":"briandavidvaughn@gmail.com"},{"name":"clauderic","email":"clauderic.d@gmail.com"},{"name":"sergei-startsev","email":"ai@programist.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-highlight-words_0.19.0_1674424603187_0.8407143626523303"},"_hasShrinkwrap":false,"readme":"<img src=\"https://cloud.githubusercontent.com/assets/29597/11913937/0d2dcd78-a629-11e5-83e7-6a17b6d765a5.png\" width=\"260\" height=\"260\">\r\n\r\nReact component to highlight words within a larger body of text.\r\n\r\nCheck out a demo [here](https://bvaughn.github.io/react-highlight-words).\r\n\r\n## Usage\r\n\r\nTo use it, just provide it with an array of search terms and a body of text to highlight.\r\n\r\n[Try this example in Code Sandbox.](https://codesandbox.io/s/5v8yqoxv7k)\r\n\r\n```jsx\r\nimport React from \"react\";\r\nimport { createRoot } from \"react-dom/client\";\r\nimport Highlighter from \"react-highlight-words\";\r\n\r\nconst root = createRoot(document.getElementById(\"root\"));\r\nroot.render(\r\n  <Highlighter\r\n    highlightClassName=\"YourHighlightClass\"\r\n    searchWords={[\"and\", \"or\", \"the\"]}\r\n    autoEscape={true}\r\n    textToHighlight=\"The dog is chasing the cat. Or perhaps they're just playing?\"\r\n  />\r\n);\r\n```\r\n\r\nAnd the `Highlighter` will mark all occurrences of search terms within the text:\r\n\r\n<img width=\"368\" alt=\"screen shot 2015-12-19 at 8 23 43 am\" src=\"https://cloud.githubusercontent.com/assets/29597/11914033/e3c319f6-a629-11e5-896d-1a5ce22c9ea2.png\">\r\n\r\n## Props\r\n\r\n| Property | Type | Required? | Description |\r\n|:---|:---|:---:|:---|\r\n| activeClassName | String |  | The class name to be applied to an active match. Use along with `activeIndex` |\r\n| activeIndex | Number |  | Specify the match index that should be actively highlighted. Use along with `activeClassName` |\r\n| activeStyle | Object |  | The inline style to be applied to an active match. Use along with `activeIndex` |\r\n| autoEscape | Boolean |  | Escape characters in `searchWords` which are meaningful in regular expressions |\r\n| className | String |  | CSS class name applied to the outer/wrapper `<span>` |\r\n| caseSensitive | Boolean |  | Search should be case sensitive; defaults to `false` |\r\n| findChunks | Function |  | Use a custom function to search for matching chunks. This makes it possible to use arbitrary logic when looking for matches. See the default `findChunks` function in [highlight-words-core](https://github.com/bvaughn/highlight-words-core) for signature. Have a look at the [custom findChunks example](https://codesandbox.io/s/k20x3ox31o) on how to use it. |\r\n| highlightClassName | String or Object |  | CSS class name applied to highlighted text or object mapping search term matches to class names. |\r\n| highlightStyle | Object |  | Inline styles applied to highlighted text |\r\n| highlightTag | Node or String |  | Type of tag to wrap around highlighted matches. Defaults to `mark` but can also be a React element (class or functional) |\r\n| sanitize | Function |  | Process each search word and text to highlight before comparing (eg remove accents); signature `(text: string): string` |\r\n| searchWords | Array<String &#124; RegExp> | ✓ | Array of search words. String search terms are automatically cast to RegExps unless `autoEscape` is true. |\r\n| textToHighlight | String | ✓ | Text to highlight matches in |\r\n| unhighlightClassName | String |  | CSS class name applied to unhighlighted text |\r\n| unhighlightStyle | Object |  | Inline styles applied to unhighlighted text |\r\n| unhighlightTag | Node or String |  | Type of tag applied to unhighlighted parts. Defaults to `span` but can also be a React element (class or functional) |\r\n| * | any | | Any other props (such as `title` or `data-*`) are applied to the outer/wrapper `<span>` |\r\n\r\n## Custom highlight tag\r\n\r\nBy default this component uses an HTML Mark Text element (`<mark>`) to wrap matched text, but you can inject a custom\r\ntag using the `highlightTag` property. This tag should be a React component that accepts the following properties:\r\n\r\n| Property | Type | Description |\r\n|:---|:---|:---|\r\n| children | String | Text to be highlighted |\r\n| highlightIndex | Number | Index of matched text |\r\n\r\nFor example:\r\n\r\n```js\r\nconst Highlight = ({ children, highlightIndex }) => (\r\n  <strong className=\"highlighted-text\">{children}</strong>\r\n);\r\n```\r\n\r\n## Installation\r\n\r\n```\r\nyarn add react-highlight-words\r\n```\r\n\r\n```\r\nnpm i --save react-highlight-words\r\n```\r\n\r\n## License\r\n\r\nMIT License - fork, modify and use however you want.\r\n","publish_time":1674424603389,"_cnpm_publish_time":1674424603389,"dist-tags":{"latest":"1.0.0"}}