npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-cli-rlc

v1.0.4

Published

cli for generating react components

Downloads

1

Readme

Simple CLI for generating react components like Angular CLI does

How to install

It's easy, just run npm i react-cli-rlc

Usage

Navigate to the directory in your project where you need to create a component. Then type command in the terminal rlc -g -c myTest. This command will generate:

  1. Folder - named MyTest. Every passed name wil be capitalized.
  2. File with component - named MyTestComponent.js. Programm adds word Component to original name and sets with deafult file extension js.
  3. File with styles - named MyTestComponent.module.css. Programm add word Component to original name + concatenates prefix module. Thus you may write your styles that won't override each other.
  4. File with reexport - named index.js which serves for reexporting files from your component making imports to other files more beautiful.

Also, file with component will contain some template code as well as index file.

Commands

  • rlc - name of package. Works the same as node or npm.

  • --generate - tells programm what should be generated. For now it's a components only, so after --generate or -g there should be flag --component or -c and component name right after it <component name>.

  • --component <component name> or -g -c <component name> - generates folder and files with the passed name: file with functional React component, index file for reexport and file with styles, e.g --genarate --component test or -g -c <component name> will create : folder Test => TestComponent.js => TestComponent.module.scss => index.js.

  • --extension <file extension> or -ext <file extension> - sets the extensions of component file. Thus you can make your component in js, jsx , ts, tsx. By default js extension is applied. Also, if you set jsx or tsx extension of index file will remain js or ts nevertheless.

  • --skip <option> or -s <option> - allows not to render some files or folder.

    Options:

    • reexport - skips index file with reexport, e.g --skip reexport or -s reexport.
    • styles - skips file with styles, e.g --skip styles or -s styles.
    • dir - skips parent dirirectory and generates files only, e.g --skip dir or -s dir. By default all three files and parent directory are generated.

Also you may pass several options to skip several files, e.g --skip dir styles reexport. In this case only one file with a react component wil be created.

  • --template <component type> or -T <component type - allows to generate file with template of functional or class component. Types func or class are accepted, e.g --template class or -T class. Functional component template func is default.

  • --styles <styles format> or -S <styles format> - here you can pick up your prefered way of styling components.

    Options:

    • css - creates file with css extension, e.g --styles css or -S css.
    • scss - creates file with scss extension, e.g --styles scss or -S scss.
    • styled - creates file with js extension and prefix styled, like TestComponent.styled.js in order to allow you to work with styled-component library or @emotion, e.g --styles styled or -S styled. CSS styles format css is default.