bun运行时

winget install Oven-sh.Bun安装
bun --version 版本
bun upgrade 升级
bun index.ts 运行
bun run start添加以下运行

"scripts": {
 "start": "bun run index.ts"
}
index.ts
const server = Bun.serve({
  port: 3000,
  fetch(req) {
    return new Response("Bun中国!");
  },
});
console.log(`Listening on http://localhost:${server.port} ...`);

bun init 创建项目
bun build index.ts --compile --outfile hi打包项目
bun add安装
bun remove 删除

作者:Yoby  创建时间:2025-12-04 11:24
最后编辑:Yoby  更新时间:2025-12-04 11:43
上一篇:
下一篇: