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

@jackxing875/linx

v1.0.2

Published

A fast CLI to scan a codebase and summarize code statistics.

Readme

linx 是一个轻量、直接、适合终端使用的命令行工具,用来扫描项目目录并输出:

  • 按语言分组的行数统计
  • 总行数 / 代码行 / 注释行 / 空行
  • 最大文件排行
  • 一些简短的趣味指标
  • JSON / CSV 导出

它的目标不是做成一个臃肿的分析平台,而是让你在几秒内看懂一个项目的大致规模和结构。

当前已发布的 npm 包:

@jackxing875/[email protected]

快速安装:

npm install -g @jackxing875/linx
linx .

功能特性

  • 语言分布统计与可视化条形图
  • 最大文件 Top N
  • 注释行和空行统计
  • 自动读取 .gitignore
  • 支持命令行追加忽略规则
  • 导出为 JSON / CSV
  • 支持彩色输出,也支持纯文本输出

安装

发布到 npm 之后,用户可以直接全局安装:

npm install -g @jackxing875/linx

如果你想固定安装 1.0.0 版本:

npm install -g @jackxing875/[email protected]

安装后直接使用:

linx .

如果不想全局安装,也可以直接临时运行:

npx @jackxing875/linx .

如果你想直接运行固定版本:

npx @jackxing875/[email protected] .

本地开发

先安装依赖:

npm install

直接从源码运行:

node ./bin/linx.js .

如果你想把命令名固定成 linx 来测试:

npm link
linx .

用法

linx [dir]

示例:

# 扫描当前目录
linx

# 扫描指定目录
linx ./src

# 只显示前 10 个最大文件
linx . --top 10

# 追加忽略规则
linx . --ignore coverage dist '*.snap'

# 导出为 JSON
linx . --export ./stats.json

# 导出为 CSV
linx . --export ./stats.csv

# 关闭颜色输出
linx . --no-color

输出示例

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
LINX  scanning ./my-project
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

248 files  21,447 lines  18,902 code / 1,841 comments / 704 blank

TypeScript     ███████████████████░░░░░  58.2%   12,481 lines
JavaScript     ██████░░░░░░░░░░░░░░░░░░  17.8%    3,819 lines
HTML           ████░░░░░░░░░░░░░░░░░░░░  11.1%    2,380 lines
CSS            ██░░░░░░░░░░░░░░░░░░░░░░   7.3%    1,566 lines
Python         █░░░░░░░░░░░░░░░░░░░░░░░   5.6%    1,201 lines

Top Files
src/api/router.ts     847 lines · TypeScript
src/core/config.ts    611 lines · TypeScript
src/index.ts          488 lines · TypeScript

Fun Facts
Coffee needed: ~38 cups
Reading time: 9.5 hours
Hottest file: src/api/router.ts (847 lines)

Generated in 0.43s

命令选项

| 参数 | 说明 | |---|---| | --top <n> | 显示最大的前 n 个文件 | | --export <file> | 导出为 .json.csv | | --ignore <pattern...> | 在 .gitignore 之外追加忽略规则 | | --no-color | 关闭彩色输出 | | --help | 查看帮助 |

linx 会扫描什么

当前版本已支持常见源码和文本文件类型,例如:

TypeScript、JavaScript、Python、Rust、Go、Java、C、C++、C#、CSS、HTML、Markdown、JSON、YAML、TOML、Shell、SQL、Ruby、PHP、Swift、Kotlin、XML、Dockerfile、Makefile。

同时会自动处理这些场景:

  • 读取项目根目录的 .gitignore
  • 跳过 node_modules/dist/build/coverage/ 等常见目录
  • 过滤二进制文件

导出

目前支持两种导出格式:

  • .json:适合脚本、自动化和后续处理
  • .csv:适合表格工具和轻量分析

示例:

linx . --export ./stats.json
linx . --export ./stats.csv

发布

如果你要自己发布新版本,流程可以保持成这样:

npm login
npm test
npm run pack:check
npm publish --access public

License

GNU General Public License Version 3, 29 June 2007