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

xiaocai-0506

v1.0.0

Published

<!-- * @Author: your name * @Date: 2021-10-12 10:17:19 * @LastEditTime: 2021-10-12 13:26:54 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \s_1904-a_gao5_stu\day1\README.md -->

Downloads

1

Readme

通过 npm 下载全局包 webpack (已经下载过了)

  • npm i webpack -g

通过 npm 下载 Vue 到线上环境

  • npm i vue -S

通过 npm 下载 axios 到开发环境

  • npm i axios -D

setState 是异步还是同步

  • setState 在合成事件和钩子函数中是异步操作,在原生事件和 setTimeout,Interview 等 API 事件中是同步操作

react 虚拟 dom 是怎样实现的

-⾸先说说为什么要使⽤ Virturl DOM,因为操作真实 DOM 的耗费的性能代价太⾼,所以 react 内部使⽤ js 实现了⼀套 dom 结构,在每次操作在和真实 dom 之前,使⽤实现好的 diff 算法,对虚拟 dom 进⾏⽐较, 递归找出有变化的 dom 节点,然后对其进⾏更新操作。为了实现虚拟 DOM,我们需要把每⼀种节点类 型抽象成对象,每⼀种节点类型有⾃⼰的属性,也就是 prop,每次进⾏ diff 的时候,react 会先⽐较该节 点类型,假如节点类型不⼀样,那么 react 会直接删除该节点,然后直接创建新的节点插⼊到其中,假如 节点类型⼀样,那么会⽐较 prop 是否有更新,假如有 prop 不⼀样,那么 react 会判定该节点有更新,那 么重渲染该节点,然后在对其⼦节点进⾏⽐较,⼀层⼀层往下,直到没有⼦节点。