New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

create-react-components-script

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-react-components-script

A node script to easily create both Functional and Class React components.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Create React Components Script

A node script to easily create both Functional and Class React components.

About

While building up my React projects I found myself creating the same directory structure for all the new components I would create. Each component consisted of a folder named the same as the component with two files, the index.js and the actual component with the name of the component as the name of the file. So this node script when run, will use inquirer to prompt and create said files for you.

project
│   README.md
│   ...  
│
└───src
│   │   App.js
│   │   ...
│   │
│   └───components
│       │____Button
|       |   |__ Button.js
|       |   |__ index.js
│       │____NavBar
|       |   |____NavBar.js
|       |   |____index.js
│       │   
│   └───pages
│       │   Landing.js
|       |   |____Landing.js
|       |   |____index.js
│       │   Search.js
|       |   |____Search.js
|       |   |____index.js
│       │   ...

Instructions

  • Clone this project and cd into it

git clone git@github.com:jtung23/create-react-components-script.git

cd create-react-components-script

  • With Ubuntu 16.04+ to set up executable (this works for my computer)

    • Move react-component (not the .js file) to /usr/bin/
      • (example) sudo mv react-component /usr/bin/
      • Mac: /usr/local/bin
    • Restart terminal and test with command, react-component
    • Will prompt for class/function component and name
  • To set up executable for other systems

    • pkg
    • npm install -g pkg
      • This package allows you to create the exectuable file for linux, macos, and windows

FAQs

Package last updated on 18 Nov 2018

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