# rc-generate

> nodejs

Latest version **0.5.2** (published 2020-12-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install rc-generate
pnpm add rc-generate
yarn add rc-generate
bun add rc-generate
```

Provides the command `rc-generate`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.2 |
| Published | 2020-12-01 |
| First published | 2020-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 36.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | wiloke1 |
| Maintainers | longnguyen |

## Links

- npm: https://www.npmjs.com/package/rc-generate
- Repository: https://github.com/wiloke1/rc-generate
- Homepage: https://github.com/wiloke1/rc-generate#readme
- Issues: https://github.com/wiloke1/rc-generate/issues
- npm.io page: https://npm.io/package/rc-generate

## Dependencies (2)

- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.1
- [commander](https://npm.io/package/commander.md) ^6.2.0

## Recent versions

- 0.5.2 (latest) — 2020-12-01
- 0.1.1-1 (next) — 2020-11-11
- 0.5.1 — 2020-11-30
- 0.5.0 — 2020-11-23
- 0.4.0 — 2020-11-12
- 0.3.1 — 2020-11-12
- 0.3.0 — 2020-11-12
- 0.2.5 — 2020-11-12
- 0.2.4 — 2020-11-12
- 0.2.3 — 2020-11-12
- 0.2.2 — 2020-11-12
- 0.2.1 — 2020-11-12
- 0.2.0 — 2020-11-12
- 0.1.2 — 2020-11-11
- 0.1.1 — 2020-11-11
- … 1 more at https://npm.io/package/rc-generate/versions

## README

# rc-generate

React CLI to generate components ( Reactjs + React Native)

[![npm version](https://img.shields.io/npm/v/rc-generate.svg)](https://www.npmjs.com/package/rc-generate)

## Use in project

**Config with package.json**

```js
{
  "rc-generate": {
    "baseUrl": "src",
    "typescript": true,
    "reactNative": false
  },
}
```

**Or config with rc-generate.config.js**

```js
const styles = `
.container {
  color: red;
}
`;
const actions = `
const getTodo = () => {
  return {
    type: 'GET_TODO',
    payload: {}
  }
}
`;
const reducers = ``;
const sagas = ``;
const thunks = ``;

const config = {
  baseUrl: 'src',
  typescript: true,
  reactNative: false,
  templates: {
    styles,
    actions,
    reducers,
    sagas,
    thunks
  }
}
module.exports = config;
```

## Easy use with npx

```bash
npx rc-generate --style scss --redux saga --component:name components/Button
```

## Or use with npm global

**Install**

```bash
npm install rc-generate -g
```

**Usage**

```bash
rc-generate --style scss --redux saga --component:name components/Button
```

## Options

| Option                      | Type                        | Default    | Description |
| :---------                  | :-------:                   | :-----:    | :----------- |
| -c:type, --component:type   | `function, class`           | `function` | Generate a component type ( example: Button or components/Button) |
| -c:name, --component:name   | `string`                    | -          | Generate a component name  |
| -s, --style                 | `css, scss, react-native`   | -          | Generate a style |
| -r, --redux                 | `thunk, saga`               | -          | Generate a redux state management |
| -V, --version               | -                           | -          | output the version number |
| -h, --help                  | -                           | -          | display help for command |

## License

MIT © [wiloke1](https://github.com/wiloke1)

---
_Source: https://npm.io/package/rc-generate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
