{"name":"react-highlight-words","version":"0.18.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":"4f760280aeaed751cec34ea0531892b7c68e6d49","_id":"react-highlight-words@0.18.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-5z+46eLPjB4JWgOhuQ0E+6iUPTD1U3amiy5KKjzZmeJ5zyvHr91hnzBT3UHya/KlySm5KRTKpYpba9vs67oO2A==","shasum":"ff3b3ef7cb497fa2e8fa4d54c1a1a98ac6390d0e","tarball":"http://registry-npm.ywwl.com/react-highlight-words/download/react-highlight-words-0.18.0.tgz","fileCount":11,"unpackedSize":1600827,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3MVDjCCP7k/82IMFT4K3+n21myKXgJbS2sD9tNKhZNgIhAJYmEMUYudRiloFVEBSpQkFR7Si8DogXVBDDk77eO/M9"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiT1HFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpoVA/+N0M+QF6XyqdQ+f1pXNBU7vPJgS9jRWUZCNZxIzmsD579zADZ\r\noCpskp5+UZBYsxaQ7f4o6Iit/O7CaGqt0ANk4/jbHxnZU2leCGhB4y5a04Cc\r\n1rADW+9BsD+tYUAZeXa0Kr5tt0uAV/iiw/6okTOEYh8PGSNcq68+aXohvA+g\r\na3oEcP6mgBlLZFifp6N4fwZK0t8jtvJ+iytM2va1KF6frTVohUm6UeoT0iwD\r\nLymdh2N4HMLqU37Ln1a53/t8/6uHh9ivBG4TGVQACw5rb1xDVefeS7KKc1SG\r\nXuFYvUzuf4FXniQ6g6DmeMRwbl3E4FbkRoHlofmN1nkBTmutcGXesWUhGUlO\r\n7HlHh2coUdVJ4YoOqQRwxjzkF+zP6dSCZNw2nG2c35JvCybzusnYwJvqf1t7\r\nPbVS4hWTgx3YtJrVo5eml3xajgCBUTiuqIy+2esHgB63UesWYALd5r907htY\r\nUMA8OObUrEAVb2+044aEOZXqx4gVI222Le0ASCVzejg+jC4LKYH9ZS78sERc\r\nHd17mEF5J+CEaEK1/zBCYLYEu17TjTRPh5/j9NDNuhPKnBDZw/0YeqiNDNaE\r\nUYTLiRnBhiDm+1e3rcSV8RVm4mXVC/xvdkG3o7Klu1Q2m9758Cbc6+xLT5AG\r\nuz7E7LWxP0icYwRq2eanoe7WpKKDEwZp4gQ=\r\n=GrEs\r\n-----END PGP SIGNATURE-----\r\n","size":445391,"noattachment":false,"key":"/react-highlight-words/-/react-highlight-words-0.18.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.18.0_1649365445452_0.8735250020213654"},"_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":1649365445898,"_cnpm_publish_time":1649365445898,"dist-tags":{"latest":"1.0.0"}}