{"repo":"moroshko/react-scanner","free":true,"listed":false,"github":"https://github.com/moroshko/react-scanner","clone":"git clone https://github.com/moroshko/react-scanner.git","description":"Extract React components and props usage from code.","language":"JavaScript","stars":657,"topics":["react","components","usage","abstract-syntax-tree","jsx","stats"],"license":"MIT","category":"ui-components","readme_excerpt":"react-scanner react-scanner statically analyzes the given code (TypeScript supported) and extracts React components and props usage. First, it crawls the given directory and compiles a list of files to be scanned. Then, it scans every file and extracts rendered components and their props into a JSON report. For example, let's say we have the following index.js file: Running react-scanner on it will create the following JSON report: Click to see it This raw JSON report is used then to generate something that is useful to you. For example, you might want to know: - How often a cetrain component is used in your design system? (see count-components processor) - How often a certain prop in a given component is used? (see count-components-and-props processor) - Looking at some prop in a given component, what's the distribution of values used? (e.g. you might consider deprecating a certain value) Once you have the result you are interested in, you can write it to a file or simply log it to the console. Installation Usage Config file Everything that react-scanner does is controlled by a config file. The config file can be located anywhere and it must export an object like this: Running react-scanner with this config would output something like this to the console: Running programmatically It is also possible to run the scanner programmatically. In this case, the config options should be passed directly to the run function. Config options Here are all the available config options: Opt","default_branch":null,"files":null,"tree":[],"storefront":"/r/moroshko","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/moroshko/react-scanner/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}