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

@ebsolutions/generate-react-templates

v1.7.2

Published

This package is used to generate React template files for a component, container, or page (NextJS)

Downloads

29

Readme

Generate React Templates

This package is used to generate React template files for a component, container, or page (NextJS). The container and component files returned can be either Typescript or Javascript depending on the flag passed.

Usage

  1. Install the package using npm or yarn:

     npm install @ebsolutions/generate-react-templates --saveDev

    or

     yarn add @ebsolutions/generate-react-templates --dev
  2. Run the desired command to generate the applicable template(s):

   node ./node_modules/@ebsolutions/generate-react-templates --type=COMP --name=taco
   node ./node_modules/@ebsolutions/generate-react-templates --type=CONT --name=taco
   node ./node_modules/@ebsolutions/generate-react-templates --type=PAGE --name=taco

NOTE: Adding --useTypescript==true to the CONT and COMP types will return Typescript (.tsx and .ts) files.

Example return value:

The package creates a the following file(s) and places them into their corresponding directory.

Page

Creates a page in the pages/ directory as shown below:

  src/pages/page-name.js

Container

Creates a container (Typescript or Javascript) in the containers/ directory with file structure below:

  containers/name-container/
     - name-container.jsx`
     - index.js
     - name-container.module.scss

Component

Creates a component (Typescript or Javascript) in the components/ directory with file structure below:

 components/name-component/
     - name-component.jsx`
     - index.js
     - name-component.module.scss

Finshing touches

  1. Getting scripts to populate package.json on install
    • "gen:comp": "node ./node_modules/@ebsolutions/generate-react-templates --type=COMP --name=taco"
    • "gen:cont": "node ./node_modules/@ebsolutions/generate-react-templates --type=CONT --name=taco"
    • "gen:page": "node ./node_modules/@ebsolutions/generate-react-templates --type=PAGE --name=taco"

Enhancements

  1. Get npx command to work or add a script to package.json that calls node ./node_modules/etc.
  2. Testing