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-do

v1.1.6

Published

A react file generator

Downloads

389

Readme

{ React Do }

Install

yarn add react-do --dev

or

npm i react-do --save-dev

Description

React Do helps save time by reading .react-do.json in your project root and creating a new file based on the configuration parameters and the templatesDir template you provide.

yarn react-do component HelloWorld

You can also specify a nested filepath

yarn react-do component People/PersonList

This will then create this file based off the configuration example below

./components/People/PersonList.js

Configuration

.react-do.json configuration example in project root

{
  "templatesDir": "./templates",
  "templates": {
    "component": {
      "ext": "js",
      "destination": "./components/"
    },
    "container": {
      "ext": "js",
      "destination": "./components/"
    },
    "model": {
      "ext": "js",
      "destination": "./models/"
    },
    "actions": {
      "ext": "js",
      "destination": "./actions/"
    },
    "store": {
      "ext": "js",
      "destination": "./stores/"
    }
  },
  "scaffold": ["component", "model", "actions", "store"]
}

Templates

You can then define a templates directory somewhere in your project that coincides with the templatesDir.

The script works off of the templates keys for finding the correct template in templatesDir.

If the destination doesn't exist it will create it for you.

Both ext and destination are mandatory.

An example template created in ./example-templates/component.js

import React from 'react';

const YourComponent = () => (
  <div className="">
  • <div>I am render, bringer of fun</div>
  </div>
);

export default YourComponent;

This will then create a component with your supplied filename via yarn react-do component YourComponent in ./components/YourComponent.js

Scaffold

You can also setup a scaffolding command by adding the templates you want to get auto generated based off the scaffold name.

example command using the config above:

yarn react-do scaffold People

This would then create ./components/People.js, ./models/People.js, ./actions/People.js, ./stores/People.js

Coming Soon

  • [ ] optional filename added to templates config will create a default filename to use for that template
  • [ ] destroy command for templates created individually or through scaffold