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 🙏

© 2025 – Pkg Stats / Ryan Hefner

uxiu-cli

v0.9.0-beta.12

Published

快速创建 koa 项目工具

Readme

安装 cli 工具

pnpm i -g uxiu-cli
# or
npm i -g uxiu-cli

# 使用以下方式临时运行
pnpx uxiu-cli
# or
npx uxiu-cli

命令使用

uxiu-cli [command] [options] [value]
# or 使用 = 传值 (help命令除外)
uxiu-cli [command] [options]=[value]
# 传递多个示例
uxiu-cli build -c=./dir1 -c=./file1

查看版本号

uxiu-cli -v
# or
uxiu-cli version

获取帮助

help 命令特殊, 不可使用 = 传值

uxiu-cli -h
# or
uxiu-cli help
# or 获取具体命令帮助
uxiu-cli -h [command]

创建项目

  • name 别名 -n 项目名称

  • root 别名 -r 创建项目的根路径, 默认为 命令运行位置

示例

uxiu-cli
# or
uxiu-cli create -n [name]

打包项目

  • pwd 别名 -p 配置文件运行根目录, 默认为 命令运行位置

  • entry 别名 -e 项目入口文件路径, 默认为 ./src/index.ts

  • outDir 别名 -o 打包输出路径, 默认为 ./dist

  • format 别名 -f 输出格式 默认为 esm

  • platform 别名 -pl 运行平台, 默认值为 node

  • unbundle 别名 -ub 不拆包, 默认为 true

  • nodeProtocol 别名 -np node 内置模块添加 node: 前缀, 默认为 true

  • config 别名 -c 打包配置文件路径, 默认为 ./uxiu-cli.config.ts

示例

uxiu-cli build

打包配置文件

默认读取 ./uxiu-cli.config.ts

示例 1

// 借助 defineBuild() 函数获取类型提示
import { defineBuild } from 'uxiu-cli'

export default defineBuild({
	// 书写配置
})
  • tsdownOptions tsdown 选项, 该选项将覆盖 uxiu-cli 选项

  • event 事件

    • beforeBuild 打包前事件, 仅配置文件支持

    • hook:beforeBuild 打包前钩子函数(若返回 Promise 将进行等待), 仅配置文件支持

    • afterBuild 打包后事件, 仅配置文件支持

    • hook:afterBuild 打包后钩子函数(若返回 Promise 将进行等待), 仅配置文件支持

    • error 打包错误事件, 仅配置文件支持

    • hook:error 打包错误事件钩子函数(若返回 Promise 将进行等待), 仅配置文件支持

示例 2

// 借助 configToJSON5() 将代码配置转为静态 json5 配置
import { configToJSON5 } from 'uxiu-cli'

const json5Text = await configToJSON5(path)
  • path code 文件绝对路径

示例 3

// 使用 tsdown
import { tsdown } from 'uxiu-cli'

tsdown.build // tsdown 包