
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@anephenix/rcg
Advanced tools
A Node.js library and CLI for generating React components.
npm i @anephenix/rcg
There are 2 ways that you can use RCG - via CLI, or as an NPM module in your Node.js code.
After you have installed rcg, cd into your React app, and run this:
npx rcg MyComponent
This will do the following:
You can also generate the component in a different folder:
npx rcg LoginPage --directory pages
This will generate a folder called 'login-page' in the pages folder, such as for a Next.js app.
To add custom DOM to insert into the React component, you can pass the --dom
flag:
npx rcg NavBar --dom="<div id='logo'>Logo here</div>"
To add custom CSS to insert into the SASS file for the component, you can pass the --css
flag:
npx rcg NavBar --css="#logo { color: #ffcc00;}"
You can load it this way:
const path = require('path');
const rcg = require('@anephenix/rcg');
const componentName = 'MyComponent';
const srcFolderPath = path.join(process.cwd(), 'src', 'components');
(async () => {
await rcg(componentName, srcFolderPath);
})();
If you want the React component to include custom DOM and/or the SASS file to include custom CSS, you can also pass these parameters:
const path = require('path');
const rcg = require('@anephenix/rcg');
const componentName = 'MyComponent';
const srcFolderPath = path.join(process.cwd(), 'src', 'components');
const customDOM = '<p>Hello</p>';
const customCSS = 'p { color: red; } ';
(async () => {
await rcg(componentName, srcFolderPath, customDOM, customCSS);
})();
npm t
© 2019 Anephenix OÜ. RCG is licensed under the MIT License.
FAQs
React Component Generator
The npm package @anephenix/rcg receives a total of 88 weekly downloads. As such, @anephenix/rcg popularity was classified as not popular.
We found that @anephenix/rcg demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.