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

resource-picker

v1.0.0

Published

项目中图片提取,oss下载模版链接提取

Downloads

5

Readme

Resource Picker - 项目资源提取工具

一个用于扫描并提取项目中图片资源与模板下载链接的 Node.js 命令行工具,输出精简合并结构。

功能特性

  • 🖼️ 图片扫描: 扫描本地图片文件与代码中的网络图片链接(jpg, png, svg, gif 等)
  • 📄 模板扫描: 扫描本地模板文件与代码中的下载类链接(仅识别 .xls/.xlsx/.doc/.docx/.pdf)
  • 🧹 协议无关去重: 对 URL 忽略 http/https 协议、host 小写、保留 pathname+search;data: 原样
  • 📦 精简输出: 统一输出 { images: [], ossTemplates: [] } 到单个 JSON 文件

安装

# 安装依赖
npm install

# 构建项目
npm run build

# 全局安装(可选,开发联调)
npm link

使用方法

目前提供一个统一命令:executor。会扫描项目中的图片与可下载模板链接,并在项目根目录输出合并后的精简结构文件。

基本命令

# 扫描当前目录
resource-picker executor

# 扫描指定目录
resource-picker executor <项目路径>

# 包含 node_modules 一并扫描
resource-picker executor <项目路径> --include-node-modules

命令选项

  • --include-node-modules: 包含 node_modules 目录扫描(默认不包含)

使用示例

# 扫描 byfe-scrm 项目
resource-picker executor ../byfe-scrm

输出文件

工具会在项目根目录生成以下文件:

  • 项目名-static-resource.json: 合并后的精简结构,形如:
{
  "images": ["/relative/path/img.png", "https://example.com/a.png", "//cdn.example.com/x.svg"],
  "ossTemplates": ["https://bucket.oss-cn-xxx.aliyuncs.com/file.xlsx"]
}

支持的文件类型

图片文件

  • .jpg, .jpeg, .png, .gif, .svg, .webp, .ico, .bmp

模板文件

  • .xlsx, .xls, .doc, .docx, .pdf, .zip, .rar, .tar, .gz

代码文件(用于匹配资源与提取链接)

  • .ts, .tsx, .js, .jsx, .vue, .html, .css, .less, .scss, .json

开发

# 开发模式运行
npm run dev

# 构建
npm run build

项目中图片提取,oss下载模版链接提取