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

ync-react-expose

v0.1.0

Published

React,Expose,log

Downloads

43

Readme

简介

日志曝光打点组件。曝光规则:

  • 初始漏出页面即曝光;用户有操作后漏出页面 50%(包括上下左右方向)才曝光
  • 一直停留在页面当前元素只会曝光一次
  • 再次曝光需要离开可视区域后再次进入可视区域且时间间隔需要超过 seconds 秒
  • 支持列表曝光渲染,不会新增多余元素
  • 如果客户端提供返回回调,则点击返回也会曝光一次

如何开发

# 安装依赖
npm ci

# 发布前构建
npm run build

# 发布
npm publish

如何使用

// == 安装:  
npm i ync-react-expose --save

// == 引用
import Expose from 'ync-react-expose'

// == 调用
<Expose seconds={10} openDebugger={false} expose={() => {
    // == 调用打点事件
}}>
    <div>曝光主体<div>
</Expose>

参数描述

| 参数名 | 类型 | 是否必须 | 说明 | 默认值 | | --- | --- | ---- | --- | --- | | seconds | number | 否 | 曝光时间间隔 | 10 | | expose | function | 否 | 曝光事件主体函数 | () => {} | | openDebugger | boolean | 否 | 控制台是否输出曝光跟踪: 1、元素信息:包括当前元素宽高、距离可视区域上下左右距离2、时间信息:当前时间、上次离开时间、时间间隔 | false |

demo 地址

openDebugger 开启

debugger