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

hyperthymesia

v2.1.6

Published

> 超忆症(英语:Hyperthymesia,源自古希腊语 hyper(“过度”)和thymesis(“记忆”))。又称完全记忆,指一个人拥有超常自传性记忆,可以记住自己一生中主要的个人经历和事件(无选择记忆)。

Downloads

4

Readme

Hyperthymesia

超忆症(英语:Hyperthymesia,源自古希腊语 hyper(“过度”)和thymesis(“记忆”))。又称完全记忆,指一个人拥有超常自传性记忆,可以记住自己一生中主要的个人经历和事件(无选择记忆)。

初始化

| 参数名称 | 类型 | 必须 | 默认值 | 描述 | |---------|----------------|-----|------------|------------------------------------| | pid | int | 是 | - | 产品ID | | service | string | 是 | - | 主服务 | |target| string | 是 | - | 目标服务:普通级别 | |target4Warning| string | 否 | - | 目标服务:警告级别 | |target4Error| string | 否 | - | 目标服务:错误级别 | |cookieKeys| [string] | 否 | - | cookie键名 | |queryKeys| [string] | 否 | - | query键名 | |pathnameKeys| PathnameSchema | 否 | - | pathname 格式内容 | |defaultEnv| ENV | 否 | 浏览器状态下系统数据 | 默认环境:在不属于浏览器时处理 | |deviceInfo| Device | 否 | 系统数据 | 设备信息:在不属于浏览器时处理 | |defaultArgs| Object | 否 | - | 默认参数 | |huid| string | 否 | - | 用户标识,默认根据uuidV4 - 存储至 localstorage | |lazyInit| Function | 否 | - | 延迟初始化函数 | |initId| number | 否 | - | 初始化ID |

defaultEnv、deviceInfo 是为了在非浏览器环境下配置默认信息

使用

getInstance

获取单例,避免多次设定,减少后续的配置

const hyperthymesia = require('hyperthymesia')
const h = hyperthymesia.getInstance()
h.log()

通过实例执行 log、warn、error 等方法,同 console 的方法一样,使用效果可以发送三级(普通,警告,错误)日志

数据默认发送到 target

有额外配置需求可以配置 target4Warningtarget4Error

log

普通日志:lv = 0

warn

警告日志:lv = 1

易错事件或者警告问题,容易造成错误逻辑或者逻辑不正常,但是不会出现异常

fail

错误日志:lv = 2

高危事件,会影响到用户正常行为,切造成损失的问题,如:下单、支付请求错误

参数信息

设备信息

| 参数名称 | 类型 | 描述 | |----------|--------|-------| | sw | number | 屏幕宽度 | | sh | number | 屏幕高度 | | dpr | number | 设备像素比 | | language | string | 设备语言 | | platform | string | 设备平台 | | ua | string | 设备UA | | uad | string | 设备 UA Data |

初始化参数

lazyInit 逻辑:将初始化延迟,返回对应初始化参数,可以进行打点时候通过 log 方法调用

initId 初始化 ID: 支持可配置