{"id":16488565,"url":"https://github.com/alecaivazis/react-docs","last_synced_at":"2026-05-18T19:04:26.133Z","repository":{"id":73020512,"uuid":"130517376","full_name":"AlecAivazis/react-docs","owner":"AlecAivazis","description":"A utility to generate documentation for every component exported by a single file","archived":false,"fork":false,"pushed_at":"2018-05-21T06:58:40.000Z","size":251,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T17:50:28.779Z","etag":null,"topics":["documentation","documentation-generator","flowtype","react"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlecAivazis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-21T22:43:42.000Z","updated_at":"2019-11-26T21:00:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"b47d9765-2c77-4d4e-baa1-df78f1adc9c1","html_url":"https://github.com/AlecAivazis/react-docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlecAivazis/react-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlecAivazis%2Freact-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlecAivazis%2Freact-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlecAivazis%2Freact-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlecAivazis%2Freact-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlecAivazis","download_url":"https://codeload.github.com/AlecAivazis/react-docs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlecAivazis%2Freact-docs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278931651,"owners_count":26070788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentation","documentation-generator","flowtype","react"],"created_at":"2024-10-11T13:39:15.636Z","updated_at":"2025-10-08T10:44:30.461Z","avatar_url":"https://github.com/AlecAivazis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-docs\n\nA utility to generate documentation for every component exported by a single file\n\n\n[![Build Status](https://travis-ci.com/AlecAivazis/react-docs.svg?branch=master)](https://travis-ci.com/AlecAivazis/react-docs)\n\n\n## Usage\n\nThe primary usecase for `react-docs` is to collect a description of every component\nexported by a particular module. Currently `react-docs` only supports collecting prop \ninformation by looking for FlowType definitions. For example:\n\n```javascript\nimport { collectExports } from 'react-docs'\n\n// the path of the root index.js of a package/module that we want to document\nconst { components } = await collectExports('/absolute/path/to/my/package/index.js')\n\n// do something with the list of components\nconsole.log(components)\n```\n\nThe description of each component is returned as an object of the form:\n```javascript\n{\n    filepath: String // the absolute path to the component declaration\n    props: {\n        prop1: {\n            value: String      // a pretty printed string of the flow definition\n            required: Boolean  // whether the prop is required or not\n            nullable: Boolean  // whether `null` is a valid value\n        }\n    }\n}\n```\n\nnote: The prop table for the exported types is also returned under the `types` field.\n\n\n### Aliasing global packages\n\nBy default (for now), `react-docs` will ignore types imported from global packages. In order to provide \na location to retrieve definitions from a global package, you can pass a second argument to `collectExports`\nthat provides location aliases, for example:\n\n```javascript\nawait collectExports('/absolute/path/to/my/package/index.js', {\n    alias: {\n        \"quark-core\": path.resolve(__dirname, \"node_modules\", \"quark-core\", \"src\", \"index.js\")\n    }\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecaivazis%2Freact-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falecaivazis%2Freact-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecaivazis%2Freact-docs/lists"}