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

wscfan-ai-tools

v1.0.0

Published

A useful front-end tool library with debounce, throttle and encryption/decryption functions

Downloads

2

Readme

wscfan-ai-tools 🛠️

一个轻量级的前端工具库,提供防抖、节流以及常见的加解密功能。

安装 💾

npm install wscfan-ai-tools

使用方法 🚀

浏览器引入

<script src="node_modules/wscfan-ai-tools/dist/wscfan-ai-tools.min.js"></script>

模块引入

import WscfanAiTools from 'wscfan-ai-tools';
// 或者
const WscfanAiTools = require('wscfan-ai-tools');

功能列表 📋

防抖函数 (Debounce)

// 基础用法
const debouncedFunc = WscfanAiTools.debounce(myFunction, 300);
window.addEventListener('resize', debouncedFunc);

// 高级用法(带取消功能)
const advancedDebounce = WscfanAiTools.debounceAdvanced(myFunction, 500, {
  leading: true,
  trailing: false
});
advancedDebounce.cancel(); // 取消防抖

节流函数 (Throttle)

// 限制函数每秒最多执行一次
const throttledFunc = WscfanAiTools.throttle(myFunction, 1000);
window.addEventListener('scroll', throttledFunc);

加密解密功能 🔐

MD5加密

const hash = WscfanAiTools.md5('hello world');
console.log(hash); // 输出: 5eb63bbbe01eeed093cb22bb8f5acdc3

SHA256加密

const hash = WscfanAiTools.sha256('hello world');
console.log(hash); // 输出SHA256哈希值

AES加密解密

const encrypted = WscfanAiTools.aesEncrypt('敏感数据', '密钥');
const decrypted = WscfanAiTools.aesDecrypt(encrypted, '密钥');
console.log(decrypted); // 输出: 敏感数据

Base64编码解码

const encoded = WscfanAiTools.base64Encode('Hello World');
const decoded = WscfanAiTools.base64Decode(encoded);
console.log(decoded); // 输出: Hello World

HMAC-SHA256签名

const signature = WscfanAiTools.hmacSha256('data', 'secret');
console.log(signature); // 输出HMAC签名

API文档 📚

debounce(func, wait, immediate)

  • func: 需要防抖的函数
  • wait: 延迟时间(毫秒)
  • immediate: 是否立即执行,默认false

throttle(func, limit)

  • func: 需要节流的函数
  • limit: 时间限制(毫秒)

aesEncrypt(data, key)

  • data: 需要加密的数据
  • key: 密钥

aesDecrypt(encryptedData, key)

  • encryptedData: 需要解密的数据
  • key: 密钥

版本信息 ℹ️

当前版本: v1.0.0

许可证 📄

MIT License