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

@littlelittlecloud/dak

v0.1.0-20260409.5450628

Published

大案牍库 — RSS Feed 数据包,提供 feeds 访问与全文搜索能力

Readme

dak — 大案牍库

RSS Feed 数据包,提供 feeds 访问与全文搜索能力

将大案牍库的所有 feed 条目打包为 npm 包,内置 MiniSearch 搜索引擎,支持多维度搜索。

安装

npm install dak

功能

1. Feeds — 访问所有 feed 条目

import { getFeeds, getFeedsByCategory, getFeedById, getFeedsByTags } from "dak";

// 获取所有条目
const all = getFeeds(); // FeedEntry[]

// 按分类
const finance = getFeedsByCategory("finance");

// 按标签
const macro = getFeedsByTags(["宏观", "经济"]);

// 按 ID
const entry = getFeedById("7705eefeb6d0");

// 按时间范围
import { getFeedsByDateRange } from "dak";
const march = getFeedsByDateRange("2026-03-01", "2026-03-31");

// 获取元信息
import { getCategories, getSources, getAllTags } from "dak";
getCategories(); // ["finance", "news", "social", "tech"]
getSources();    // ["AP News", "Bloomberg Markets", ...]
getAllTags();     // ["中东", "经济", "美国", ...]

2. Search — 多维度搜索

基于 MiniSearch 构建,支持:

  • 关键词全文搜索(标题 + 正文,标题权重 3×)
  • 属性过滤:category / source / tags / author / language
  • 仅标题搜索
  • 时间范围过滤
  • 模糊匹配 + 前缀匹配
import { createSearchIndex } from "dak";

const index = createSearchIndex();

// 全文搜索
const results = index.search({ query: "inflation" });

// 按分类 + 关键词
const financeResults = index.search({
  query: "oil prices",
  category: "finance",
});

// 按标签 + 时间范围
const filtered = index.search({
  tags: ["经济", "美国"],
  dateFrom: "2026-03-01",
  dateTo: "2026-03-31",
});

// 仅搜索标题
const titleResults = index.search({
  query: "jobs report",
  titleOnly: true,
  limit: 10,
});

// 搜索建议 (自动补全)
index.suggest("inflat");
// ["inflationary inflation", "inflation", "inflationary", "inflated"]

// 索引统计
const stats = index.stats();
// { totalDocuments: 9707, categories: [...], sources: [...], ... }

SearchResult 类型

interface SearchResult {
  entry: FeedEntry;      // 匹配的 feed 条目
  score: number;         // 相关度评分
  matchedFields: string[]; // 匹配的字段
}

CLI 工具

安装后可直接使用 dak 命令搜索:

# 全文搜索
dak search "inflation"

# 按分类 + 关键词搜索
dak search "oil price" -c finance --from 2026-03-01

# 仅标题搜索
dak search "AI" --title-only -n 10

# 列出条目
dak feeds -c tech -n 5
dak feeds -t 经济 -t 美国 --content

# 按标签 + 时间搜索
dak search -t 中东 -t 地缘政治 --from 2026-03-01

# 索引统计
dak stats

# 搜索建议
dak suggest "inflat"

# JSON 输出 (便于管道处理)
dak search "tariff" --json | jq '.[0].entry.title'

CLI 选项

| 选项 | 说明 | |------|------| | -c, --category <cat> | 按分类过滤 | | -s, --source <src> | 按来源过滤 | | -t, --tag <tag> | 按标签过滤 (可多次使用) | | -a, --author <author> | 按作者过滤 | | --from <date> | 发布时间起始 (YYYY-MM-DD) | | --to <date> | 发布时间截止 (YYYY-MM-DD) | | --title-only | 仅搜索标题 | | -n, --limit <n> | 返回数量 (默认 20) | | --json | JSON 格式输出 | | --content | 显示正文摘要 |

FeedEntry 类型

interface FeedEntry {
  id: string;        // 唯一 ID (hash)
  title: string;     // 标题
  source: string;    // 来源名称
  sourceUrl: string; // 来源 URL
  link: string;      // 文章链接
  author: string;    // 作者
  published: string; // 发布时间 (ISO string)
  fetched: string;   // 抓取时间 (ISO string)
  category: string;  // 分类 ID
  tags: string[];    // 标签列表
  language: string;  // 语言
  guid: string;      // RSS GUID
  filename: string;  // 文件名
  content: string;   // 正文 (Markdown)
}

构建

cd pkg
bun install

# 从 feeds/ 目录生成 data/feeds.json
bun run build:data

# 编译 TypeScript
bun run build:ts

# 一键构建
bun run build

License

MIT