UNPKG

react-gen-kit

Version:
72 lines (51 loc) โ€ข 2.29 kB
# Hi, I'm Dewanshu! ๐Ÿ‘‹ ## Made with โค๏ธ for React developers. # ๐Ÿ› ๏ธ CLI for React A powerful and flexible CLI tool to **interactively generate** React components, pages, hooks, or providers โ€” with full support for JavaScript or TypeScript, styles, testing, and configurable paths. --- ## โœจ Features - ๐Ÿ”ง Interactive CLI (like Vite!) - โš›๏ธ Generate: - React Components - Pages - Hooks - Providers - ๐Ÿง  Supports both **JavaScript** and **TypeScript** - ๐ŸŽจ Style file support (`css`, `scss`, with optional CSS Modules) - ๐Ÿงช Optional test file using **React Testing Library** - ๐Ÿ“‚ Custom output path or generate in the current directory - ๐Ÿ› ๏ธ Configurable via `.componentclirc.json` --- ## ๐Ÿ“ฆ Installation <!-- You can use it globally or locally โ€” your choice! ### ๐Ÿ“Œ Option 1: Global install ```bash npm install -g react-gen-kit react-generate [options] (For Custom Path and Current working directory) Example 1: react-generate -c Example 2: react-generate --path < your custom path > ``` --> ### ๐Ÿ“Œ Option 1: Use via npx ```bash npm install react-gen-kit npx react-gen-kit [options] (For Custom Path and Current working directory) Example 1: npx react-gen-kit -c Example 2: npx react-gen-kit --path < your custom path > ``` ### ๐Ÿ“Œ Option 2: As an npm script in your project ```bash Step 1: npm install react-gen-kit Step 2: Add this to package.json scripts: "scripts": { "generate": "react-generate" }, Step 3: Run this command in terminal "npm run generate [options]" Example 1: npm run generate -c Example 2: npm run generate -- --path < your custom path > ``` ## ๐Ÿ› ๏ธ CLI Options | Parameter | Type | Description | | :---------------- | :-------- | :---------------------------------------------------------------------------- | | `--path`,`-p` | `string` | Custom relative path to place the component (e.g. `shared/ui`) | | `--current`,`-c` | `boolean` | Generate the component inside a `components/` folder in the current directory | <!-- | `<ComponentName>` | `string` | **Required**. Name of the React component to generate | -->