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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ds_chonky

v1.0.4

Published

Readme

react+typescript+webpack Boilerplate

This boilerplate could help you start to play react with Hot reload

Getting Started

Create a new directory then

    npm init -y

Dependencies

Install dependencies


npm install react@latest react-dom@latest react-hot-loader

Install development dependenices

Babel

npm install webpack webpack-cli web-dev-server html-webpack-plugin --save-dev

ESLint Airbnb

npx install-peerdeps --dev eslint-config-airbnb
npx install babel-eslint --save-dev

Cross-env

npm install cross-env -save-dev

Setup

create .babelrc.json

{
    "presets":[
        "@babel/preset-env",
        "@babel/preset-react"
    ],
    "plugins":[
        "react-hot-loader/babel"
    ]
}

create .eslintrc.json

{
  "parser": "babel-eslint",
  "extends": ["airbnb"],
  "env": {
    "browser": true
  },
  "rules": {
    "arrow-parens": "off",
    "comma-dangle": ["error", "never"],
    "no-confusing-arrow": "off",
    "no-unused-expressions": "off",
    "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
    "react/jsx-one-expression-per-line": "off"
  },
  "plugins": [
    "react"
  ]
}

webpack.config.js

const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const { env } = process;
const path = require('path');
const options = {
  mode: env.NODE_ENV,
  entry: "./index.js",
  output: {
    filename: 'index.js',
    path: path.resolve(__dirname, 'dist'),
    publicPath: '/',
  },
  module: {
    rules: [
      { test: /\.(js|jsx)$/, loader: "babel-loader", exclude: /node_modules/ },
      //To allow Webpack to load Typescript files, Let's add support for the .ts and tsx extensions
      { test: /\.(tsx|ts)$/, loader: "ts-loader", exclude: /node_modules/, },
    ],
  },
  resolve: {
    extensions: ["*", ".js", ".jsx", ".tsx", ".ts"],
  },
  plugins: [
    new webpack.DefinePlugin({
      "process.env.NODE_ENV": JSON.stringify(env.NODE_ENV),
    }),
    new CleanWebpackPlugin(),
    new HtmlWebpackPlugin()
  ],

  devServer: {
    hot: true,
  },
  devtool:
    env.NODE_ENV === "development" ? "source-map" : undefined,
};

module.exports = options;

package.json

#script section explain
"scripts": {
    "clean": "rimraf dist",
    //启动example做扩张程序
    "start": "cross-env NODE_ENV=development webpack-dev-server --hot",
    "build": "cross-env NODE_ENV=development webpack",
    //生成库文件为第三方程序引用
    "pub": "npm run clean && tsc -p .",
    "lint": "eslint ./src"
  },

Installing typescript

npm install --save-dev @types/react @types/react-dom

create tsconfig.json file like so:

    {
        "complierOptions":{
            //generate .d.ts filest
            "declaration":true,
            "strict":true,
            "moduleResolution":"node",
            "rootDir":"./src",
            "sourceMap":true,
            "jsx":"react",
            "target":"ES6",
            "noResolve": false,
            "noImplicitAny": false,
            "removeComments": true,
            "outDir": "dist",
            // interop between ESM and CJS modules. Recommended by TS
            "esModuleInterop": true,
            "importHelpers": true,
            // significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS
            "skipLibCheck": true,
            // `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc`
            // "noEmit": true,
            "skipDefaultLibCheck": true,
            "strictNullChecks": false
        }
    }
  • How/where to download your program
  • Any modifications needed to be made to files/folders

Executing program

  • lib test
npm start
  • lib publish
npm run pub