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

v1.0.0

Published

Structure for a new react project.

Downloads

2

Readme

Structure

I created this boilerplate to optimize our time when we create a new project. I use it for my personnals projects and if you have any questions ask them to me inside the contact on my website : www.vincentbenoit.com.

The list of the links packages

Express

http://expressjs.com/

Webpack 2

https://webpack.js.org/configuration/

React router dom

https://reacttraining.com/react-router/web/guides/quick-start

React redux

http://redux.js.org/

Redux Logger

https://github.com/evgenyrodionov/redux-logger

Sass

https://github.com/webpack-contrib/sass-loader

Assets

https://github.com/webpack-contrib/file-loader https://github.com/webpack-contrib/extract-text-webpack-plugin

Testing

If you would like to know how works Jest please try this great tutorial : https://www.sitepoint.com/test-react-components-jest/ Jest's documentation : https://facebook.github.io/jest/docs/api.html#writing-assertions-with-expect React utils : https://facebook.github.io/react/docs/test-utils.html

Usage

Start the server : npm start If you would like to run the jest's watch use the command line : npm test -- --watch

Create a form

If you wanna use the form component you should use it like below.

1) Import the components

import Form from 'FormCore/Form' import Input from 'FormCore/Input' import Submit from 'FormCore/Submit'

2) Use them

// ...

render() { return( ) }

// ...

3) Props

A) For the Form You can add a function inside the onSubmit to retrieve the data inside the component. Otherwise, nothing happened. <Form onSubmit={ data => this.myArrowFunction(data) }> ...

B) For the input Availables props : - name {string} (required) - type {string} (text by default) - value {string} - placeholder {string} - pattern {string} - min {number} - max {number} - autofocus {boolean} - validate {array of string} (required and email are availables)

<Input
  name="myName"
  type="text"
  value={this.state.value}
  placeholder="say my name"
  validate={['required']}
/>

C) For the textarea Availables props : - name {string} (required) - value {string} - placeholder {string} (none by default) - autofocus {boolean} (false by default) - validate {array of string} (required and email are availables) - maxlength {number} (none by default) - wrap {string} soft|hard soft by default

  <Textarea
    name="aDescription"
    validate={['required']}
    autofocus={true}
    maxlength="42"
  />

D) For the submit's button Availables props : - label {string} ('Send' by default)

  <Submit />