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

@dfsj/hooks

v4.0.0-alpha.2

Published

通用的vue3 hooks函数

Readme

@dfsj/hooks

Vue3 组合式函数库,30+ 开箱即用的 Hooks,覆盖异步请求、状态管理、存储、UI交互等场景

version license

简介

@dfsj/hooks 是 Vue 3 组合式函数库,提供 30+ 开箱即用的 Hooks,覆盖异步请求、状态管理、本地存储、UI 交互、防抖节流等常见场景,零依赖、Tree-Shaking 友好。

主要功能

  • Async 异步 - useRequest(请求缓存/轮询/重试)
  • Side 副作用 - useDebounce / useThrottle / useInterval
  • State 状态 - useBoolean / useToggle / useDate / useLocalStorage / useCookie
  • UI 交互 - useVirtualList / useFullscreen / useMediaQuery / useQRCode
  • Advanced 高级 - useLockFn(防重复执行)

安装

pnpm add @dfsj/hooks

快速开始

<script setup lang="ts">
import { useRequest, useBoolean } from '@dfsj/hooks'

// 异步请求(自动 loading / error)
const { data, loading, refresh } = useRequest(api.getUserInfo)

// 布尔状态管理
const [visible, { toggle }] = useBoolean(true)
</script>

主要导出

| 分类 | 导出名 | 说明 | |:-----|:------|:-----| | Async | useRequest | 强大的请求 Hook | | Side | useDebounce / useThrottle | 防抖/节流 | | State | useBoolean / useToggle | 布尔状态 | | State | useLocalStorage / useCookie | 持久化存储 | | UI | useVirtualList | 虚拟列表 | | UI | useFullscreen / useMediaQuery | 响应式 |

完整 API 文档请查看 在线文档站

使用要求

| 环境 | 要求 | |:-----|:-----| | Node.js | >=18.12.0 | | 框架依赖 | Vue >=3.3 |

开发指南

git clone http://10.10.12.18/dfsj/dfsj
pnpm install
cd packages/hooks
pnpm watch

文档

许可证

MIT

Copyright (c) 2022 - present yangbo