@rihan.taher/create-react-component-cli
v1.0.2
Published
Create react or typescript component with command line
Maintainers
Readme
Installation:
The provided instructions are for installing and using a tool called create-react-component-cli to generate React components. Here's a breakdown of the installation and usage instructions:
Global Installation (Recommended): To install the tool globally, run the following command:
npm install -g @rihan.taher/create-react-component-cliDevelopment Dependency Installation: Alternatively, you can install it as a development dependency by running:
npm install --save-dev @rihan.taher/create-react-component-cliCreate React Component
Once the tool is installed, you can create a React component by using the npx component command followed by the desired component path and name. For example:
npx component src/components/headerBy default it will create a jsx component, a css module file
Additional Flags: There are a few flags you can use to customize the generated component:
-jsxor-tsx: Specify the file format for the component (JSX or TypeScript with JSX).-cssm: Create a CSS module file for the component.-test: Generate a test file for the component.
Changing Default Settings: If you want to change the default settings, you can use the npx component set command followed by the desired flag and value. For example:
npx component set -cssm=falseAllowed settings are:
-test=(true/false): Toggle test file generation.-cssm=(true/false): Toggle CSS module file generation.-format=(jsx/tsx): Set the default file format for components (JSX or TypeScript with JSX).
