Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-flux-cli

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-flux-cli

A simple CLI to generate the basic structure of React and Flux files

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-flux-cli

A simple CLI to generate the basic structure of React and Flux files.

React-flux-cli help you to generate some React/Flux files.

Based on the configuration file, react-flux-cli automatically resolves all relative paths to the dependences of the generated files.

A configuration file is generated at ~/.rfcli.json

Installation :

npm install -g react-flux-cli

Example :

Create a single file :

All directory can be modified in the config file.

React-flux-cli does not modify existing files and does not create non-existent folder. To force the writing or editing you can use the -f option ( --force )

rfcli -j Home
// => Create HomeComponent file in ./components 

rfcli -a Home
// => Create HomeActions file in ./actions 

rfcli -s Home
// => Create HomeStore file in ./stores 

rfcli -c Home
// => Create HomeConstants file in ./constants 

Create all files :

Execute rfcli without option will generate all files.

rfcli -A Home
// => Create HomeComponent file in ./components
// => Create HomeActions file in ./actions 
// => Create HomeStore file in ./stores 
// => Create HomeConstants file in ./constants 

Configuration :

The default component structure based on sublime-react.

Defaults flux files structure based on Flux Todo list.

To use your own file structure, you can edit ~/.rfcli.json.

To transform your code into one line, you can use : FreeFormatter.

  • <FileType>_PATH : [String] The path to store files according to the file type
  • SUFFIX : [Boolean] Enable/Disable the suffix file name (e.g : Home => HomeComponent, HomeActions ...)
  • filesContent : [Object] Store the files's structure (compared to "component", "advancedComponent" has some functions to comply the flux structure)
//~/.rfcli.json
{
  "COMPONENT_PATH": "components",
  "ACTIONS_PATH": "actions",
  "STORE_PATH": "stores",
  "CONSTANTS_PATH": "constants",
  "SUFFIX": true,
  "filesContent": {
    "component": "var React = require('react'); ...",
    "advancedComponent": "var React = require('react'); ...",
    "actions": "var AppDispatcher = require('../dispatcher/AppDispatcher'); ...",
    "store": "var AppDispatcher = require('../dispatcher/AppDispatcher'); ...;",
    "constants": "var keyMirror = require('keymirror'); ..."
  }
}

License

MIT

Keywords

FAQs

Package last updated on 12 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc