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 🙏

© 2026 – Pkg Stats / Ryan Hefner

wxbtest33

v2.0.0

Published

test

Readme

手淘--我的空间--卡片页

我的空间Card总体接入方案

接入规范

我的空间Card页面整体采用react开发,因此建议各接入方最好能够采用react开发。为了避免直接在现有分支上直接改代码造成逻辑混乱使得后期难以维护,最好是通过提供一个组件的形式来进行接入。类似于下面这样:

/* 接入方demo */
/* 接入方的module, 可以发布到tnpm */
export defualt xxxReactModule; 
/* 外层card容器 */
import xxxReactModule from '@alife/xxxReactModule';
import xxxReactModule2 from '@alife/xxxReactModule2';
import xxxReactModule3 from '@alife/xxxReactModule3';

React.render(
    <div className="card-container" data-spm="1">
        <xxxReactModule />
        <xxxReactModule2 />
        <xxxReactModule3 />
    </div>,
    document.querySelector('#root')
);

设计规范

需要注意的点

  • 坑位外层结构

    <div class="card-container">
        <!--各个card坑位-->
        <div class="card card-xxx"></div>
        <div class="card card-xxx"></div>
        ...
    </div>
  • 点击card跳转

    如果你的card需要点击跳转到一个H5页面,不要使用location.href = xxxurl的方式(因为这样会在现有的webview上打开H5),如果要实现跳转到新的页面,需借助windvane提供的接口进行跳转。示例如下:

    /* navToH5方法参见src/js/utils/util.js */
    navToH5(url);
  • card的spm埋点

    如果点击各接入方card需要跳转到指定的H5页面,需要在外层容器上添加data-spm参数做spm埋点,目前data-spm第三位

    /* 监听你的点击事件, 参见src/js/utils/util.js */
    const jumpHandler = e => {
        let jumpHref = e.currentTarget.getAttribute('data-href');
        try {
          jumpHref = new HttpUrl(jumpHref);
      
          if (window.g_SPM && window.g_SPM.spm) {
            let g = window.g_SPM.spm(currentTarget);
            jumpHref.params.spm = g;
          }
          jumpHref = jumpHref.toString();
        } catch (e) {}
          
        navToH5(jumpHref); // 进行跳转
    };
    /* 监听点击事件 */
    jumpElement.addEventListener('click', jumpHandler, 'false');

技术选型

使用React

目录结构

src/css

  • _mixin.scss _reset.scss: 公用css

  • index.scss: 主css

src/js

  • components 存放展示型component & 容器component

    • Card 卡片页
  • utils 一些公共方法,sdk,MtopAPI等

    • api.js 常用api接口

    • utils.js 一些通用方法,navToH5, getUrlWithSpm

  • index.js 入口js