react-docgen is a CLI and toolbox to help extracting information from React components, and generate documentation from it. It uses @babel/parser to parse the source into an AST and provides methods to process this AST to extract the desired information. The output / return value is a JSON blob / JavaScript object. It provides a default implementation for React components defined via React.createClass, ES2015 class definitions or functions (stateless components). These component definitions must follow certain guidelines in order to be analyzable. Installing the module adds a react-docgen executable which allows you to convert a single file, multiple files or an input stream. We are trying to make the executable as versatile as possible so that it can be integrated into many workflows. By default, react-docgen will look for the exported component created through React.createClass, a class definition or a function (stateless component) in each file.

Features

  • You can change that behavior with the --resolver option
  • Have a look at example/ for an example of how to use the result to generate a markdown version of the documentation
  • react-docgen will look for a babel configuration and use it if available
  • The tool can be used programmatically to extract component information and customize the extraction process
  • Locating/finding the nodes in the AST which define the component
  • Extracting information from nodes

Project Samples

Project Activity

See All Activity >

Categories

Documentation

License

MIT License

Follow react-docgen

react-docgen Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of react-docgen!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Documentation Software

Registered

2022-09-07