2023年各个前端框架和组件库的 npmmirror 总下载量

2023年过完了.

这次直接统计 2023年国内镜像 npmmirror 的下载量!!!

结论

2023年国内 react 比 vue 多 300w 的下载量 (数据来源: npmmirror )

2023年国外 npm 的 react 每周下载量稳定在 2000w左右, vue 400w左右, 相差5倍

代码

使用 tsx 执行

import axios from 'axios';
import qs from 'node:querystring';

let _host = "https://registry.npmmirror.com/downloads/range";
let _range = "2023-01-01:2023-12-31";

Promise.all([
    getData("react"),
    getData("vue"),
    getData("@angular/core"),
    getData("svelte"),
    getData("solid-js"),

    getData("next"),
    getData("nuxt"),

    getData("@mui/material"),
    getData("antd"),
    getData("element-ui"),
    getData("vuetify"),
    getData("element-plus"),
    getData("ant-design-vue"),
    getData("@chakra-ui/react"),
    getData("react-bootstrap"),
    getData("reactstrap"),
    getData("primereact"),
    getData("iview"),
    getData("view-ui-plus"),
]).then(r => {
    // 从高到低 排序
    r.sort((a, b) => b.counts - a.counts);

    console.table(r)
})


async function getData(packageName: string) {
    let url = `${_host}/${_range}/${qs.escape(packageName)}`;
    // console.log(url);
    let counts = 0;

    let r = await axios.get(url).then(r => r.data)
    delete r.versions
    let dataList = r.downloads;  
    for (const item of dataList) {
        counts += item.downloads
    }

    return { name: packageName, counts: counts };
}
vuejs·reactjs
101 views
Comments
登录后评论
Sign In
·

###henichuntiandoufengxiatianduoyu! NzA2ZTRlMzg5MjQ1YTAyMTc5MjUzM2MxZDQwYzkwYTA1ZjE3MzE2YmZiMDQ5NDFiMjRhZWM4Njg4MDVkYTQyYzdlMjJiN2QxM2I2NjZhNWQ2M2ExZWFjODM2YzczNg==#

·

为什么特意要删除这个属性

delete r.versions