
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
generate-react-component
Advanced tools
An opinionated CLI generator for ReactJS components.
As a ReactJS developer, from time to time, I have to create components of same structure, by manual copy & paste. It is a time consuming no-brainer process that any React dev may repeat everyday.
Typically, there are two kinds of components: Functional and Class Components, the basic structure of either could always look the same, in one project:
Functional Component:
import React from 'react'
const Cmp = (props) => {
return (
<div className={s.cover} style={bgStyle} >
</div>
)
}
export default Cover
Class Component:
import React, { Component } from 'react'
class Cmp extends Component {
componentDidMount() {
}
render() {
return (
)
}
}
export default Cmp
It should be a super easy tool to automatically generate these files, without manual new file creation or copy & paste. So, here you are.
Run
npm install -g generate-react-component
You may need to sudo it.
Run
rcmp <ComponentName>
This will create a folder of your component name, and a Class Component js file with the same name.
Run
rcmp <ComponentName> --pure
or
rcmp <ComponentName> -p
This will create a folder of your component name, and Pure Function Component js file of the same name.
Run
rcmp <ComponentName> --pure --css
or
rcmp <ComponentName> -p -c
This will create a folder of your component name, and component (Functional if --pure) js file of the same name, and a css file of the same name.
Enjoy and feel free to share your suggestion!
###TODO
yarn add globalsupportFAQs
Generate a react component with CLI
We found that generate-react-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.