GithubHelp home page GithubHelp logo

grabbou / react-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from madebyform/react-cli

0.0 0.0 0.0 13 KB

A command line interface tool that seeks to automate some tasks when working on a React.js project

License: MIT License

JavaScript 100.00%

react-cli's Introduction

react-cli

A command line interface tool that seeks to automate some tasks when working on a React.js project.

Getting Started

Install the react command line tool globally so you can use it from any project directory.

$ npm install -g madebyform/react-cli

Commands

Create an Application

$ react new my-app

This command sets up a new react application inside the my-app directory. This is what you get out of the box:

  • Isomorphic Node configuration
  • ES6 support via babel
  • Express server + EJS templating system
  • React router configuration

The application will have the following directory structure:

my-app/
  assets/
  src/
    components/
    utils/
    views/

Generate React components

$ react generate MyComponent firstProp:string secondProp:requiredObject

This creates a skeleton mycomponent.jsx file inside your src/components directory.

Component Lifecycle methods

By default, the resulting file includes React lifecycle methods, like componentWillMount. You can skip these by passing in either -l or --skip-lifecycle to the command above. To know more run $ react generate -h.

Property Types

Currently supported property types:

Optional Props Required Props
any requiredAny
array requiredArray
bool requiredBool
func requiredFunc
number requiredNumber
object requiredObject
string requiredString

Usage

Use the --help flag for a complete list of options and commands.

$ react --help

  Usage: react <command> [options]


  Commands:

    new <name>                                        Generate a new react app boilerplate.
    generate [options] <name> [propName:PropType...]  Generate a new react component.
  Options:

    -h, --help     output usage information
    -V, --version  output the version number

License

Available under the MIT license.

react-cli's People

Contributors

dmfrancisco avatar fbatista avatar pgaspar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.