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

@hack0303/cland-excel-cli

v0.2.2

Published

AlaSQL Excel/CSV SQL console — import spreadsheets, query with SQL, export results

Readme

cland-excel-cli

基于 AlaSQL.js 的 Excel/CSV 数据控制台 — 拖入文件即可用 SQL 查询、聚合、连接工作表,并导出结果。

功能

  • 导入:拖拽或选择 .xlsx / .xls / .csv 文件,全部数据仅在浏览器本地处理,不上传任何服务器
  • 多工作表:自动解析所有工作表(含中文表名),注册为 SQL 表([表名] 引用),点击可复制表名
  • SQL 查询:AlaSQL 引擎,支持 WHERE / GROUP BY / JOIN / ORDER BY / 聚合函数及 DML 写操作
  • 导出:查询结果或整个工作表可导出为 .xlsx(AlaSQL 生成)或 .csv

使用

本地开发

npm install
npm run dev        # 本地开发 http://localhost:5173
npm run build      # 类型检查 + 生产构建 (tsc -b && vite build)
npm test           # 单元测试 (vitest, Node 环境)

npm 安装使用(工具方式)

# 直接运行(无需安装,自动从 npm 拉取最新版)
npx cland-excel-cli

# 或全局安装后使用
npm i -g cland-excel-cli
cland-excel-cli --port 8080 --no-open

启动后自动打开浏览器(--no-open 关闭),默认端口 4173(--port / PORT 环境变量可改)。 服务的是构建产物 dist/,数据纯本地处理。

示例

examples/game/ 包含游戏策划标准配置表(28 张表)的规范文档、生成脚本与示例文件:

node examples/game/generate.mjs   # 重新生成 examples/game/game-config.xlsx

加载该文件后试试:

-- 过滤高品质物品
SELECT * FROM [item] WHERE quality >= 2

-- 掉落表 × 物品表连接
SELECT d.item_id, i.name, d.weight FROM [drop] d JOIN [item] i ON d.item_id = i.id ORDER BY d.weight DESC

-- 按道具大类聚合
SELECT category, COUNT(*) AS cnt FROM [item] GROUP BY category

技术栈

Vite 8 · SolidJS 1.9 · TypeScript 6 · AlaSQL 4(SQL 引擎)· xlsx (SheetJS, 解析/导出) · Vitest

目录结构

src/
├── index.tsx        入口
├── App.tsx          界面:上传区 / 工作表侧栏 / 预览与 SQL 查询面板
├── App.css          样式
└── excel.ts         数据层:AlaSQL 封装(导入/注册/查询/导出)
tests/
└── excel.test.ts    数据层测试(含游戏配置表示例回归)
examples/game/       游戏配置表示例(规范 + 生成脚本 + 示例 xlsx)

开发说明

  • 数据层(src/excel.ts)与 UI 解耦:浏览器传 File 走 alasql 浏览器读取分支,Node 传路径走 fs 分支(测试用)
  • 表名规则:小写 + 下划线,保留中文(如 Sales Data → sales_data、全资产台账 → 全资产台账),纯符号回退 tN,冲突自动追加序号,SQL 中用 [表名] 引用
  • 中文注释行(游戏导表规范第 2 行)会作为普通数据行出现,可用 WHERE 过滤