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

JSErrorMonitor

v1.0.1

Published

页面javascript错误监控系统:http://status.flybyte.cn。

Downloads

5

Readme

JSErrorMonitor

页面javascript错误监控系统:http://status.flybyte.cn。登录用户名admin,密码admin

使用

在页面中引用JSErrorCollector,并将错误上报的API地址修改为JSErrorMonitor-server的后台服务的地址,这样在页面报错时会将错误信息上传给错误监控系统JSErrorMonitor。
本地开发调试需要后台API支持,请部署JSErrorMonitor-server或者自己实现,API代理转发配置在cfg/base.js

用户界面:

  • 首页: 首页
  • 列表页: 列表页
  • 详情页: 详情页
  • 图表页: 图表页

安装

  1. 通过npm install安装所有依赖
  2. 项目本地开发调试依赖于webpackyeoman所以需要先全局安装二者
  3. 项目是基于generator-react-webpack生成的,更多用法请参考generator-react-webpack

命令

应用的框架和库

src目录结构

actions:redux的actions目录
components:react的组件目录
config:开发配置目录
constants:常量目录
favicon.ico
images:图片目录
index.html:页面
index.js:页面的入口js
reducers:redux的reducers目录
stores:redux的store目录
styles:redux的样式目录
utils:js工具方法目录

ES6与JSX harmony语法

项目默认开启ES6与JSX harmony语法支持

  • ES6教程:深入浅出ES6
  • 模块化:支持import语法,项目的node_modules目录会作为模块根目录

新建react组件

运行yo react-webapck:component path/to/name,会生成

  • src/components/path/to/NameComponent.js
  • src/styles/path/to/name.scss
  • test/components/NameComponentTest.js

redux开发:

  1. src/constants/actionType.js新增action type
  2. src/actions目录下新增action,并通过src/actions/index.js暴露出来
  3. src/reducers目录下新增reducer,并通过src/reducers/index.js暴露出来
  4. src/stores/configureStore.js配置新增的reducer和store的state映射关系
  5. 在react组件中通过connectmapStateToProps方法映射store的state到组件的props
  6. 在组件生命周期方法(比如componentDidUpdatecomponentWillUpmountcomponentDidUpdate等)中通过dispatch派发action
  7. 通过action引起的对象属性更新,会经过reducer映射到store的state中,再经过connectmapStateToProps引发组件的props更新,从而更新视图