{"name":"react-highlight-words","version":"0.14.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","prepublish":"npm run build","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":"^15.1.0","react-dom":"^15.1.0","react-transform-catch-errors":"^1.0.0","react-transform-hmr":"^1.0.1","redbox-react":"1.2.6","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"},"gitHead":"c11bd0a71560040ed1941b47a053cff5027b1665","_id":"react-highlight-words@0.14.0","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"brianvaughn","email":"briandavidvaughn@gmail.com"},"dist":{"integrity":"sha512-DNp1zAIiNqs1nunFv5K67ca0KVSKihbmpZLNwqQj61yMK6zf8YHoGrpLlEt7WEqj1227FOm41FuXiv9KZgcwdA==","shasum":"a1a40ff0a49ce78e7feb375a4e0a5fd1ca9c9609","tarball":"http://registry-npm.ywwl.com/react-highlight-words/download/react-highlight-words-0.14.0.tgz","fileCount":13,"unpackedSize":3149646,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfvvGCRA9TVsSAnZWagAAn9IQAJLHFeZiIuLuxWuwlQI1\npZ5lDsnlVUmZt5rFGW6WzNhmlsT7it+/Fa6AyQZJmIDx7JrT46Yeq0CBpjgp\nxQL1OuLqwDLMCBGi0UjaiMVvQxhaMcZqovH25em/XNqu1lFxzoxZbkAjCx4R\nElapzvbtz7FXCz8U5Xcnwljk8aWHuzlqJqkUasdMJqGIdgqaxkxFA71vjiHY\nESjnAfvt66BW8gvEyCFPfU151jZ22sxpVBv8jDd4ZNCYgWjtQumDECf1numm\nzgonsnRsv6QLAqPdsp30fK+gi5JgEisDv6uPFb/+QyuRRVMoX67WPR0U/Xed\nsgyiJNJEn5D2y3Lc5XhLfN64LojVia/WBa7uZZi5AaIj+yoYozAtmzkQR+Vg\nMRA+Y1CpAIwU5Ay2WiXbE25oYPjCTqZmC48lH6A8LcxqiDLQzW/Cb+LNRIFd\nHzjb6s7AhYGu0mVxbWecZcS9/bYml6Buaq2gM9bjg/Ms7asLkvAh7n8c+Xds\n1x8vzopz38JCqsKZkNO+au3sznbSo2onq2L/79uaH0Wi0qneIGsqaQNGtxoa\n7AdR0P2H9wyqqF0BgJSqz8+fTTZtSDXSKsTHzMRcOk1eM9ZCMF4jTjSH3K7N\niaAyLZ+g3Mqqh6py2Q1vCF0aE/69+xQTl+gj4XtqziLO7tah7+3saSepuhOZ\nwVv/\r\n=yqOM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDm4OaFGMLLOKbmC9geiebBP7EKO+Mh3UMIWoECwBenCwIhAK6seG8v3QY+mr0bo1Ae3HIJ45dtk8x145o4Dwzjg2lm"}],"size":793196,"noattachment":false,"key":"/react-highlight-words/-/react-highlight-words-0.14.0.tgz"},"maintainers":[{"name":"brianvaughn","email":"briandavidvaughn@gmail.com"},{"name":"clauderic","email":"clauderic.d@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-highlight-words_0.14.0_1535048645493_0.6780647886211906"},"_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":1535048645885,"_cnpm_publish_time":1535048645885,"dist-tags":{"latest":"1.0.0"}}