SuperAPI AI 工具集

bun-development

编程与开发

查看项目

更新于 10-16 06:21

技能介绍

用途:面向使用 Bun 运行时进行 JavaScript/TypeScript 开发的场景,包括新建项目、从 Node.js 迁移、提升开发速度、使用 Bun 内置工具以及排查 Bun 特有问题。主要能力:包管理(bun install、bun add、bun remove、bun update、bun outdated、bunx)、依赖锁文件(bun.lockb,可用 bun install --yarn 生成 yarn.lock)、直接运行 TS/JS(bun run index.ts)、监视与热重载(bun --watch run、bun --hot run)、内置 API(Bun.file、Bun.write、Bun.serve、WebSocket、bun:sqlite、Bun.password)、内置测试(bun test、bun:test 及 expect/mock/spyOn)、打包与编译(bun build,支持 --minify --target --sourcemap,--compile 生成独立可执行文件)。使用方式:安装支持 macOS/Linux 的 curl -fsSL https://bun.sh/install | bash、Windows 的 powershell -c "irm bun.sh/install.ps1 | iex",以及 Homebrew、npm、bun upgrade;项目初始化用 bun init 或 bun create;配置 package.json 与 tsconfig.json(依赖 @types/bun、types 设为 bun-types)。适用场景:新建 JS/TS 项目、Node.js 迁移、使用内置打包器与测试运行器、追求启动与安装速度。限制:资料中的性能对比数据仅为文档说法;require、require.resolve、non_webpack_require 等 Node 专有用法可能不兼容,process.hrtime()、setImmediate() 等全局行为存在差异;具体收费、价格与官方支持范围暂未提供。