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

create-react-easy

v1.0.2

Published

create-react-easy is a react cli for dealing with your templates. When you install this package, it will bring everything ready, such as react-router-dom, useContext and even useReducer. Just type and get everything ready.

Downloads

6

Readme

Please use this library just for beginning of your project!!!

This is Heading

create-react-easy is a react cli for dealing with your templates. When you install this package, it will bring everything ready, such as react-router-dom, useContext and even useReducer. Just type and get everything ready.

Installation

Use the node package manager [npm] to install create-react-easy.

There are two ways. If you are planning to make your job easy while working with routes, just type this command:

npx create-react-easy app-name "route"

If you are going to make easy working with context use:

npx create-react-easy app-name "context"

if you do not put your app-name, it will automatically take the name of your current folder. or you can run:

npx create-react-easy ./ "context"

Usage of route

After installation, on the component everything is ready for you, just put your path and element and start your work.


    // Here everything is ready, just need to usage !!!
    // Just change path names and elements then just work on.

    function App() {
        return (
          <>
            <Routes>
              <Route path="/" element={<Home />} />
              <Route path="/login" element={<Login />} />
              <Route path="*" element={<Error />} />
            </Routes>
          </>
        );
}

Usage of context

There are two important files to use context, context.js and current file that you are working on, it can be Home or any other component. On the constext.js file everything is ready for you. Your job is just to create and export any value from context.

Example: context.js

    import React, { useContext } from 'react';

    const AppContext = React.createContext();


    export const AppProvider = ({ children }) => {

        // Text - 1
        const home = "Home"

        return <AppContext.Provider value={{

            // export all elements
            home

        }}>
            {children}
        </AppContext.Provider>
    }

    export const useGlobalContext = () => {
        return useContext(AppContext);
    }

In Above we created [home] value that is equal to "Home" and then exported it. And now, we have access to [home] from any file. In order to have access to need to also follow this instraction:

Example

    import React from 'react'

    // importing our useGlobalContext from context.js

    import { useGlobalContext } from '../context/context'

    const Home = () => {

        // Having access to home

        const { home } = useGlobalContext();

        return (

            // using the home value 

            <div>{home}</div>

        )
    }

export default Home

Contributing

Pull request are welcome. For major chnages, please open an issue first to discuss what you would like to change.

fazliddin_fayziev

[https://github.com/FazliddinFayziev]