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

vite-plugin-cy-ban

v2.0.2

Published

vite 自定义引入 ban

Readme

vite-plugin-cy-ban

🚫 一个 Vite 插件,用于自动引入 cy-plugin-ban 。
支持在开发和生产环境中生效,可配置重定向、替换页面内容以及自定义回调。


✨ 功能特性

  • 禁止右键菜单
  • 禁止文字选中
  • 禁止复制粘贴
  • 禁止拖拽图片
  • 禁止双指缩放
  • 禁止双击放大
  • 禁止键盘快捷键打开开发者工具
  • 控制台打开后支持:
    • 页面重定向
    • 替换页面内容
    • 执行回调函数

📦 安装

# 插件
npm install cy-plugin-ban --save

npm install vite-plugin-cy-ban --save-dev

🚀 使用方法

import { defineConfig } from 'vite';
import cyViteBan from 'vite-plugin-cy-ban';

export default defineConfig({
  plugins: [
    cyViteBan({
      entry: './src/main.ts', // 必须指定入口文件
      disableContextMenu: true, // 禁止右键菜单
      disableSelection: true, // 禁止文字选中
      disableCopy: true, // 禁止复制
      disablePaste: true, // 禁止粘贴
      disableDragImage: true, // 禁止拖拽图片
      disableOpenDevTool: true, // 禁止键盘打开调试面板
      disableDoubleFingerScale: true, // 禁止双指缩放
      disableDoubleTouchAmplify: true, // 禁止双击放大
      redirect: 'https://www.baidu.com', // 控制台打开后重定向
      write: '<div>你被禁止了</div>', // 控制台打开后替换页面内容
      callback: () => {
        console.log('你被禁止了'); // 控制台打开后执行回调
      }
    })
  ]
});