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
$300 Free Credits for Your Google Cloud Projects Icon
$300 Free Credits for Your Google Cloud Projects

Start building on Google Cloud with $300 in free credits. No commitment, no credit card required until you're ready to scale.

Launch your next project with $300 in free Google Cloud credits—no strings attached. Test, build, and deploy without risk. Use your credits across the entire Google Cloud platform to find what works best for your needs. After your credits are used, continue with always-free tier services. Only pay when you're ready to scale. Sign up in minutes and start exploring.
Start Free Trial
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