# rn-component-generator

> CLI for creating new react-native components

Latest version **0.0.3** (published 2018-08-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install rn-component-generator
pnpm add rn-component-generator
yarn add rn-component-generator
bun add rn-component-generator
```

Provides the command `rn-component-generator`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2018-08-24 |
| First published | 2018-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Hiral Parmar |
| Maintainers | hiral.parmar |
| Keywords | react, reactjs, react-native, cli, component |

## Links

- npm: https://www.npmjs.com/package/rn-component-generator
- Repository: https://github.com/Tatvanish/rn-component-generator
- Homepage: https://github.com/Tatvanish/rn-component-generator#readme
- Issues: https://github.com/Tatvanish/rn-component-generator/issues
- npm.io page: https://npm.io/package/rn-component-generator

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) 2.0.1
- [prettier](https://npm.io/package/prettier.md) 1.5.3
- [commander](https://npm.io/package/commander.md) 2.11.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2018-08-24
- 0.0.2 — 2018-08-24
- 0.0.1 — 2018-08-24

## README

# `rn-component-generator`
### Simple, customizable utility for adding new React components to your project.

This project is a globally-installable CLI for adding new React native components. It's dead simple to use, and requires no configuration, although it's easy to customize it to fit your project's coding style.

<br />

## Features
- Simple CLI interface for adding Component, PureComponent, or Stateless Functional components.
- Uses [Prettier](https://github.com/prettier/prettier) to stylistically match the existing project.
- Offers global config, which can be overridden on a project-by-project basis.
- Colourful terminal output!


<br />

## Quickstart

Install via NPM:

```bash
$ npm i -g rn-component-generator
```
<br />

```bash
$ npm link rn-component-generator
```

## Configuration

Configuration can be done through 3 different ways:

- Creating a global `.rn-component-generator-config.json` in your home directory (`~/.rn-component-generator-config.json`).
- Creating a local `.rn-component-generator-config.json` in your project's root directory.
- Command-line arguments.

The resulting values are merged, with command-line values overwriting local values, and local values overwriting global ones.

<br />

## API Reference

### Type

Control the type of component created:
- `class` for a traditional Component class (default),
- `pure-class` for a PureComponent class,
- `functional` for a stateless functional component.

Legacy `createClass` components are not supported, although support would be easy to add. Feel free to open an issue (or a PR!).

**Usage:**

Command line: `--type <value>` or `-t <value>`

JSON config: `{ "type": <value> }`
<br />

### Directory

Controls the desired directory for the created component. Defaults to `src/`

Legacy `createClass` components are not supported, although support would be easy to add. Feel free to open an issue (or a PR!).

**Usage:**

Command line: `--dir <value>` or `-d <value>`

JSON config: `{ "dir": <value> }`
<br />

### File Extension

Controls the file extension for the created components. Can be either `js` (default) or `jsx`.

**Usage:**

Command line: `--extension <value>` or `-x <value>`

JSON config: `{ "extension": <value> }`
<br />

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