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

evter

v1.0.5

Published

## 介绍

Downloads

10

Readme

Evter 事件管理器

介绍

Evter 是一个事件管理器,用于管理事件。

安装

npm install evter

使用

import Evter from 'evter';

// 示例使用
const evter = new Evter();

function callback1(data: any) {
    console.log('回调A:', data);
}

function callback2(data: any) {
    console.log('回调B:', data);
}

function callback3(data: any) {
    console.log('回调C:', data);
}

// 绑定事件
evter.on('event1', callback1);
evter.on('event1', callback2);

// 只绑定一次事件
evter.once('event1', callback3); 

// 触发事件
evter.emit('event1', { some: 'data' });

// 取消某个事件的一个回调函数
evter.off('event1', callback1);

// 触发事件,验证回调函数是否已被取消
evter.emit('event1', { some: 'other data' });

// 取消某个事件的所有回调函数
evter.off('event1');

// 移除所有事件
evter.allClear();

// 触发事件,验证所有回调函数是否已被取消
evter.emit('event1', { some: 'data' });

// 获取所有事件及其回调函数
console.log(evter.all());

如何贡献

非常欢迎你的加入!提一个 Issue 或者提交一个 Pull Request。

Pull Request:

  1. Fork 代码!
  2. 创建自己的分支: git checkout -b feat/xxxx
  3. 提交你的修改: git commit -am 'feat(function): add xxxxx'
  4. 推送您的分支: git push origin feat/xxxx
  5. 提交pull request

Git 贡献提交规范

  • 规范 (Angular)
  • feat 增加新功能
  • fix 修复问题/BUG
  • style 代码风格相关无影响运行结果的
  • perf 优化/性能提升
  • refactor 重构
  • revert 撤销修改
  • test 测试相关
  • docs 文档/注释
  • chore 依赖更新/脚手架配置修改等
  • workflow 工作流改进
  • ci 持续集成
  • types 类型定义文件更改
  • wip 开发中