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

dsh-lit-fetch

v1.0.4

Published

DSH literature fetcher: search academic papers via DOI, download PDFs through Sci-Hub mirrors and Open Access fallback, generate batch access HTML manifests.

Readme

dsh-lit-fetch

DSH literature fetcher — search academic papers, download PDFs by DOI (Sci-Hub mirrors with Open Access fallback), and generate a batch-access HTML manifest.

DSH 文献获取插件 — 快捷搜索学术文献、通过 DOI 批量下载 PDF(Sci-Hub 镜像 + 开放获取兜底)、生成批量获取清单 HTML。

功能总览 · At a glance(中英对照 / Bilingual)

检索 / Search

| 中文 | English | |---|---| | search_papers:按 DOI 精确查询(Crossref) | search_papers: exact DOI lookup via Crossref | | 按标题/关键词检索(OpenAlex,最多 20 条) | Title/keyword search via OpenAlex, up to 20 results | | 返回标题、作者、期刊、年份、DOI、官方链接 | Returns title, authors, journal, year, DOI and canonical link |

下载 / Download

| 中文 | English | |---|---| | download_papers:按 DOI 批量下载 PDF | download_papers: batch PDF download by DOI | | Sci-Hub 优先:遍历 8 个镜像域名,解析 iframe/embed 取直链 | Sci-Hub first: walks 8 mirrors, resolves the PDF link from iframe/embed | | 开放获取兜底:Unpaywall 查 OA 免费版本 | OA fallback: Unpaywall lookup for a free version | | PDF 魔数校验(%PDF-)+ 最小体积校验(≥3KB)拦截假文件 | Magic-byte (%PDF-) and minimum-size (≥3 KB) checks reject bogus files | | 并发下载(默认 4,上限 8),先写 .part 再原子重命名 | Concurrent downloads (default 4, max 8), .part then atomic rename | | 每篇返回状态:ok / scihub-fail / oa-fail / closed-access / no-doi | Per-paper status: ok / scihub-fail / oa-fail / closed-access / no-doi | | 结果写入 _lit_fetch_report.json | Writes _lit_fetch_report.json into the output directory |

清单 / Manifest

| 中文 | English | |---|---| | generate_manifest:把拿不到的文献生成可点击清单 | generate_manifest: clickable list of papers that could not be fetched | | 输出「批量获取入口.html」,含 DOI 官方链接与状态徽章 | Emits 批量获取入口.html with DOI links and status badges | | 提供「顺序打开全部」按钮,逐条间隔 800ms 打开 | A "open all in order" button opens each link 800 ms apart |

宿主路由 / Host route

| 中文 | English | |---|---| | 注册 /lit-fetch 前缀路由,返回插件存活与版本信息 | Registers a /lit-fetch prefix route reporting liveness and version |

使用方式 · Usage

在 DSH 对话中对 agent 说 / Talk to the agent in a DSH session:

  1. 搜索 · Search:「帮我找关于 static mixer CFD 的文献」→ agent 调用 search_papers
  2. 下载 · Download:「把这些 DOI 下载到 D:\papers\」→ agent 调用 download_papers
  3. 生成清单 · Manifest:「给没下载到的文献生成获取清单」→ agent 调用 generate_manifest

下载策略 · Download strategy

  1. Sci-Hub 优先:遍历 8 个域名(sci-hub.ren / ee / st / ru / se / wf / hk、tesble.com), 解析 iframe/embed 提取 PDF 直链,流式下载并校验 %PDF 魔数。
  2. 开放获取兜底:Sci-Hub 无收录时查 Unpaywall,寻找 OA 免费版本(best_oa_location 优先, 其次遍历 oa_locations)。
  3. 最终兜底:两者均失败 → 记入清单,生成 HTML 供手动获取(向作者索取 / NSTL 文献传递)。

Sci-Hub first — walks the 8 mirrors, resolves the direct PDF link from iframe/embed. OA fallback — Unpaywall when Sci-Hub has nothing. Final fallback — the HTML manifest.

已知限制 · Known limitations

  • Sci-Hub 2021 年后基本停止收录新文献(Elsevier/Wiley/ACS 2021+ 文章大概率无收录)。
  • 直连 Sci-Hub 镜像较慢(Cloudflare 限速),建议开启 VPN/代理后使用。
  • OA 兜底仅查 Unpaywall;某些文献有 arXiv 预印本但 Unpaywall 未收录。
  • Sci-Hub stopped indexing new papers after 2021, and mirror throughput is often throttled. The OA fallback only consults Unpaywall.

安装 · Installation

dsh plugin --profile desktop add dsh-lit-fetch
# 或从本地目录 link
# cp -r dsh-lit-fetch ~/.dsh/local-plugins/

技术细节 · Technical notes

  • 宿主端纯 Node.js,无 Python 依赖 / Host-side pure Node.js, no Python dependency
  • PDF 魔数校验 + 体积校验 / Magic-byte and size validation
  • 流式下载 + 原子落盘(.part → rename)/ Streaming download with atomic rename
  • 并发控制(默认 4,最大 8)/ Bounded concurrency
  • 下载报告 JSON 自动落盘 / Automatic JSON report

License

MIT