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

azqd

v1.0.20

Published

azqd npm

Readme

NPM包管理

本地开发

$ npm run dev

本地打包

$ npm run build

NPM发布

$ npm run pub

具体发包流程及常见问题总结: https://github.com/AZQD/command仓库NPM/README.md文档;


开发指南:

module.exports和exports和export和export default的区别

module.exports和exports和export和export default的区别,import和require的区别:
https://www.jianshu.com/p/f6c5a646c00b

export default,exports.default,module.exports,require,import整理:
https://www.jianshu.com/p/8fde36da1537

babel-plugin-add-module-exports使用:
https://www.npmjs.com/package/babel-plugin-add-module-exports

.babelrc文件中必须添加:
{
  "plugins": [
    [
      "add-module-exports",
      {
        "addDefaultProperty": true
      }
    ]
  ]
}
才可以使用:export default 或 exports.default;

npm publish发布成功,但官网一直是旧版本号

重新npm login即可;

使用

安装

$ npm install azqd --save

引入

import AZQD from 'azqd';

const {CopyText, Test} = AZQD.comp;
const {debounce, throttle} = AZQD.lib;

示例

getScroll组件使用:

  import { getScroll } from 'azqd';
  const {getScrollHeight, getScrollTop, getWindowHeight} = getScroll;
  
  componentWillMount () {
      window.addEventListener('scroll', () => {
          let scrollTopDistance = getScrollTop();
          let scrollBottomDistance = getScrollHeight() - getScrollTop() - getWindowHeight();
          console.log('获取页面滚动条距离顶部的距离:', scrollTopDistance);
          console.log('获取页面滚动条距离底部的距离:', scrollBottomDistance);
          }
      )
  }

参考文档:https://www.cnblogs.com/winyh/p/6715010.html

元素观察器监听

参数

| 参数名 | 类型 | 说明 | | :-------- | :----- | ----------------------------------------- | | elements | NodeList | 必传 格式:document.querySelectorAll(".infoBox .infoItem") | | callback | function | 非必传 | | options | object | 非必传 ratio:显示/隐藏比例;poll:节流时间;repeat:是否上报多次埋点 |

示例

watchExposure(document.querySelectorAll(".infoBox .infoItem"), function (res) {
      console.log('成功回调:', res);
    }, {
      ratio: 0.5, // 显示/隐藏比例,默认值:0.5,0.5即元素显示/隐藏50%时上报;
      poll: 100, // 节流时间,默认值:100ms;
      repeat: false, // 是否上报多次埋点,默认值:false,即:仅上报一次展示埋点;
  });

返回

| 参数名 | 类型 | 说明 | | :----- | :------ | ----- | | index | number | DOM元素在伪数组中的下标 | | visibility | boolean| DOM元素是否显示 | | item | object | 监听dom节点信息 |

备注

场景1.用于列表页每条数据上报一次展示埋点;
场景2.用于列表页每条数据上报多次展示、隐藏埋点;

2025年1月17日 更新3