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

@nj_wangrizhen/webc-lib

v1.0.6

Published

轻量 Vue 组件 / 工具库。

Downloads

112

Readme

@nj_wangrizhen/webc-lib

轻量 Vue 组件 / 工具库。

安装

pnpm add @nj_wangrizhen/webc-lib
# 或
npm install @nj_wangrizhen/webc-lib

兼容说明(重要)

| 使用方式 | Vue | Vant | 说明 | |---------|-----|------|------| | 仅工具方法(下载/预览辅助/平台判断等) | 2 / 3 | 不要求 | 走 UMD,可给 Vue2 + Vant2 项目用 | | UI 组件(PdfPreview / EmailSendDialog 等) | 仅 3 | 3 / 4 | ES 产物含 createVNode,Vue2 不可直接挂组件 |

vant、pdfjs-dist 已标为 optional peer:只引工具方法时,npm 不会因 Vant2 / 未装 pdfjs 而 ERESOLVE 失败。

Vue2 项目(推荐写法)

vue.config.js:

const path = require('path')

module.exports = {
  // 转译包内可能的新语法,避免旧 babel 目标报错
  transpileDependencies: ['@nj_wangrizhen/webc-lib', 'pdfjs-dist'],
  configureWebpack: {
    resolve: {
      alias: {
        // 强制 UMD,避免拉到 Vue3 组件 ES 包
        '@nj_wangrizhen/webc-lib': path.resolve(
          __dirname,
          'node_modules/@nj_wangrizhen/webc-lib/dist/webc-lib.umd.js'
        )
      }
    }
  }
}

业务里只按需引工具:

import {
  canBatchDownload,
  canDownloadInWebview,
  downloadBlob,
  parseBlobResponse,
  preparePreviewFromBlob
} from '@nj_wangrizhen/webc-lib'

预览 / 邮箱弹层请在业务侧用 Vant2 本地实现(对齐包内组件交互即可)。

Vue3 项目

import { createApp } from 'vue'
import WebcLib from '@nj_wangrizhen/webc-lib'
import '@nj_wangrizhen/webc-lib/dist/style.css'

const app = createApp(App)
app.use(WebcLib) // 注册 WebcPdfPreviewPopup、WebcEmailSendDialog 等

需自行安装匹配的 vant@^3||^4、pdfjs-dist@^3.11.174,并把包内 pdfjs/ 静态资源部署到站点可访问路径。

Peer 依赖

{
  "vue": "^2 || ^3",
  "vant": "^2 || ^3 || ^4",      // optional
  "pdfjs-dist": "^3.11.174"     // optional
}