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

iasei-cli

v1.0.2

Published

A TypeScript CLI tool for scaffolding business front-end projects.

Downloads

426

Readme

iasei-cli 测试

一个用于业务前端项目脚手架与工具文件管理的 TypeScript CLI 工具。

简介

iasei-cli 是基于 TypeScript + Commander.js 构建的命令行工具,主要用于从远端仓库拉取并生成业务工具文件。它通过远端 list.json 维护工具清单,支持列出可用工具以及按类型创建对应的 .ts 工具文件到指定目录。

特性

  • 远端工具清单查询(list
  • name 拉取并生成工具文件(create
  • 本地命令帮助表(help
  • 支持自定义输出路径(目录或 .ts 文件)
  • 友好的终端输出(chalk 着色 + ora 进度)
  • 纯 TypeScript 实现,ESM 模块

环境要求

  • Node.js >= 18(使用 ESM 与 import.meta
  • pnpm >= 10(推荐,亦可用 npm / yarn)

安装

# 本地依赖安装
pnpm install

# 全局链接(可选,便于直接调用 iasei-cli)
pnpm link --global

使用

查看版本

iasei-cli -v
# 或
iasei-cli --version

命令:tools

iasei-cli tools [flag] [-n <name>] [-o <output>]

flag 为可选参数,取值如下:

| flag | 说明 | | --------- | ------------------------------------------------- | | list | 拉取并展示远端工具列表(表格形式) | | create | 按 --name 拉取工具文件并写入本地 | | help | 输出本地命令帮助表(列出可用命令及描述) | | 不传 | 等同于 create,但需要携带 --name,否则报错 |

选项

| 选项 | 说明 | 必填 | | ---------------------- | ------------------------------------------ | ---- | | -n, --name <name> | 工具名称(对应清单中的 key) | 是* | | -o, --output <output>| 输出路径:可为目录或 .ts 文件路径 | 否 |

* 当 flagcreate 或不传时必填;若缺失会输出红色提示并终止。list / help 时忽略。

示例

# 查看本地命令帮助
iasei-cli tools help

# 列出远端工具清单
iasei-cli tools list

# 在当前目录生成 <name>.ts
iasei-cli tools -n <name>

# 指定输出目录
iasei-cli tools -n <name> -o ./src/utils

# 指定输出文件名
iasei-cli tools -n <name> -o ./src/utils/helper.ts

输出路径规则

  • 未传 -o:写入 process.cwd()/<name>.ts
  • -o.<name>.ts 结尾:直接作为文件路径写入
  • -o 以其他 .ts 结尾:视为文件路径,直接写入
  • -o 不以 .ts 结尾:视为目录,写入 <output>/<name>.ts

配置

远端地址在 src/config.ts 中维护:

export const TOOLS_URL =
  "https://gitee.com/PurpleQuietElf/iasei-tools/raw/master/a.ts";
export const REMOTE_LIST_URL =
  "https://gitee.com/PurpleQuietElf/iasei-tools/raw/master/list.json";
  • REMOTE_LIST_URL:工具清单(数组,每项含 key / name / desc / gitUrl
  • TOOLS_URL:单个工具文件兜底地址

开发

# 直接以 tsx 运行源码(无需编译)
pnpm dev

# 类型检查 + 编译到 dist
pnpm build

# 运行编译产物
pnpm start

目录结构

src/
├── bin/
│   └── index.ts      # CLI 入口,注册 commander 命令
├── lib/
│   ├── tools.ts      # createTools / listTools 实现
│   └── help.ts       # listCommands 本地帮助表
└── config.ts         # 远端地址等常量

技术栈

  • TypeScript 5.9 + NodeNext ESM
  • commander(命令解析)
  • inquirer(交互)
  • axios(远端请求)
  • fs-extra(文件操作)
  • chalk / ora(终端着色与进度)
  • handlebars(模板)
  • download-git-repo(仓库拉取)

License

ISC