{"id":24385639,"url":"https://github.com/piyush-bhatt/generate-component-react","last_synced_at":"2026-05-21T03:05:55.067Z","repository":{"id":57246125,"uuid":"224229954","full_name":"piyush-bhatt/generate-component-react","owner":"piyush-bhatt","description":"CLI generator for ReactJS components based on specified name and options.","archived":false,"fork":false,"pushed_at":"2019-11-26T17:41:02.000Z","size":5,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-20T08:12:41.174Z","etag":null,"topics":["cli-generator","component","javascript","react","reactjs","reactjs-components"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/generate-component-react","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/piyush-bhatt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-26T15:53:06.000Z","updated_at":"2021-01-17T16:09:54.000Z","dependencies_parsed_at":"2022-08-24T16:10:49.811Z","dependency_job_id":null,"html_url":"https://github.com/piyush-bhatt/generate-component-react","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyush-bhatt%2Fgenerate-component-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyush-bhatt%2Fgenerate-component-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyush-bhatt%2Fgenerate-component-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyush-bhatt%2Fgenerate-component-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piyush-bhatt","download_url":"https://codeload.github.com/piyush-bhatt/generate-component-react/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243269027,"owners_count":20263969,"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","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":["cli-generator","component","javascript","react","reactjs","reactjs-components"],"created_at":"2025-01-19T11:19:44.411Z","updated_at":"2025-12-29T03:45:09.286Z","avatar_url":"https://github.com/piyush-bhatt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generate-component-react\n\ngenerate-component-react is a CLI generator for ReactJS components based on specified name and options.\n\n## Content\n\n* [Installation](#installation)\n* [Usage](#usage)\n  * [Functional Component](#functional-component)\n  * [Class Based Component](#class-based-component)\n  * [Options](#options)\n* [Examples](#examples)\n* [Contributing](#contributing)\n* [License](#license)\n\n\n## Installation\n\nUse the package manager [npm](https://www.npmjs.com/) to install\n\n```bash\nnpm install -g generate-component-react\n```\n\n## Usage\n\nMake sure to execute the commands from your app root directory\n\n### Functional Component\n```bash\ngenerate component \u003ccomponent-name\u003e -f\n```\n   or\n```bash\ngc \u003ccomponent-name\u003e --function\n```\n\n### Class Based Component\n```bash\ngenerate component \u003ccomponent-name\u003e -c\n```\n   or\n```bash\ngc \u003ccomponent-name\u003e --class\n```\n\n\n### Options\n\nFollowing options can be used optionally,\n\n**--css** : add a CSS module for the generated component, e.g.,\n```bash\ngenerate component \u003ccomponent-name\u003e --class --css\n```\n\n**-s** or **--state** : add state to the generated component, e.g.,\n```bash\ngenerate component \u003ccomponent-name\u003e --class --state\n```\n\n## Examples\n\n* Sample component (functional component with state and css):\n\n    ```bash\n    generate component sample --function --css --state\n\n    CREATED \u003capp-root-dir\u003e\\src\\sample\\sample.css\n    CREATED \u003capp-root-dir\u003e\\src\\sample\\sample.js\n    CREATED \u003capp-root-dir\u003e\\src\\sample\\index.js\n    ```\n* Sample component (class based component without state but with css):\n\n    ```bash\n    generate component sample --class --css\n\n    CREATED \u003capp-root-dir\u003e\\src\\sample\\sample.css\n    CREATED \u003capp-root-dir\u003e\\src\\sample\\sample.js\n    CREATED \u003capp-root-dir\u003e\\src\\sample\\index.js\n    ```\n* Sample component (functional component in nested directory without state and css):\n\n    ```bash\n    generate component components/sample --function\n\n    CREATED \u003capp-root-dir\u003e\\src\\components\\sample\\sample.js\n    CREATED \u003capp-root-dir\u003e\\src\\components\\sample\\index.js\n    ```\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiyush-bhatt%2Fgenerate-component-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiyush-bhatt%2Fgenerate-component-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiyush-bhatt%2Fgenerate-component-react/lists"}