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

file-viewer-copy-assets

v3.1.2

Published

Official npx CLI for copying File Viewer Worker, WASM, font, and vendor assets into self-hosted web projects.

Readme

file-viewer-copy-assets

Flyfish File Viewer 官方静态资源复制 CLI。full 包已经内置 preset-all,但 Worker、WASM、字体和 vendor 文件仍需要发布到静态目录;缺少这些文件时只能使用部分格式。

所有 *-full 包都会自动安装与自身完全同版本的 CLI。Webpack、Vue CLI 等非 Vite 项目直接运行它并复制到默认静态目录:

npx --no-install file-viewer-copy-assets ./public/file-viewer
# pnpm 项目也可以运行:
pnpm exec file-viewer-copy-assets ./public/file-viewer

单独使用标准包时先显式安装同版本 CLI;需要独立执行时,也可以使用带明确版本的 npx 入口:

npm install -D [email protected]
npx --yes [email protected] ./public/file-viewer

CLI 自带与当前版本严格匹配的资源载荷,会将 Worker、WASM、字体、PDF、CAD、Typst、Archive、Draw.io 和 Office vendor 资源复制到目标目录,并生成 flyfish-viewer-assets.json 完整性清单。安装或执行 --version 不会修改项目目录;只有执行复制命令时才会写入指定目标。运行时资源全部自托管,不依赖公共 CDN。

复制完成后,静态服务必须把目标目录映射为部署基址下的 file-viewer/(根部署即 /file-viewer/),并让清单、JavaScript、WASM、字体等 URL 以正确 MIME 返回。清单通过只能证明本地资源完整,不能替代 HTTP 部署检查。若资源不在这个约定目录,请同步调用 full 包导出的 setDefaultFullAssetBaseUrl()

Vite 项目优先使用 @file-viewer/vite-plugincopyAssets: true,插件会按已安装的 full/preset 自动发布资源。完整部署 @file-viewer/web-full/dist/ 的 CDN/IIFE 场景已经携带 assets,无需再次复制;只部署入口 IIFE 文件并不完整,可改用随包安装的 CLI。

用法

# 默认输出到 ./public/file-viewer
npx --no-install file-viewer-copy-assets
# pnpm 等价命令
pnpm exec file-viewer-copy-assets

# 保留目标目录中已有的其他文件
pnpm exec file-viewer-copy-assets ./public/file-viewer --no-clean

# 未安装本地依赖时,显式锁定独立 CLI 版本
pnpm dlx [email protected] ./public/file-viewer

自动化脚本可追加 --json,标准输出只包含一个机器可读结果对象;普通调用仍保留原有两行文本提示。

可使用 FILE_VIEWER_PUBLIC_DIR 设置默认输出目录,或将 FILE_VIEWER_SKIP_ASSET_COPY=1 用于需要跳过复制步骤的 CI 场景。完整部署说明见 File Viewer 文档

English: README.en.md