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

directives-expand

v1.0.1

Published

Custom Vue3 directives

Readme

Directives Expand

技术交流群 711368818

Introduction

WHAT

directives-expand 是一个专为 Vue3 打造的自定义指令扩展库。它提供了一系列实用、高效的指令,旨在简化业务开发中高频使用的交互逻辑。通过简单的指令声明,开发者可以用更少的代码实现更丰富的功能增强。

WHY

在我们的日常开发中,大量的时间被消耗在重复的交互逻辑控制上,例如:

  • 每一个防抖操作都需要手动维护定时器或编写重复的代码逻辑。
  • 文本复制功能需要处理复杂的剪切板 API 兼容性及降级方案。
  • 限制表情输入等校验逻辑常散落在各个组件的事件处理中。

directives-expand 旨在解决这些痛点。它通过将这些常见交互逻辑封装为指令,让功能实现变得更加简洁、声明化,从而显著提升开发效率和代码可维护性。

Features

  • v-copy: 智能复制指令,自动处理剪切板 API 及其降级方案,支持一键复制。
  • v-debounce: 事件防抖指令,内置便捷的防抖控制,防止非法连续触发。
  • v-noEmoji: 限制输入指令,自动过滤或禁止表情符号输入,适用于严谨的表单场景。

Quick Start

pnpm i directives-expand
import { createApp } from "vue"
import DirectivesExpand from "directives-expand"

const app = createApp(App)
app.use(DirectivesExpand)

Basic Usage

v-debounce

<template>
  <button v-debounce="handleSearch">点击防抖 (默认 500ms)</button>
  <button v-debounce:[1000]="handleSearch">自定义 1000ms 防抖</button>
</template>

<script setup>
const handleSearch = () => {
  // 业务逻辑
  console.log("进行搜索...")
}
</script>

v-copy

<template>
  <div v-copy="'Hello World'">点击我即可复制文本</div>
</template>

Links

Inspiration

Thanks to Vue.js