Bun.main
屬性包含目前進入點的絕對路徑。
console.log(Bun.main);
import "./foo.ts";
列印的路徑對應於使用 bun run
執行的檔案。
bun run index.ts
/path/to/index.ts
bun run foo.ts
/path/to/foo.ts
請參閱文件 > API > 工具程式以取得更多實用的工具程式。
Bun.main
屬性包含目前進入點的絕對路徑。
console.log(Bun.main);
import "./foo.ts";
列印的路徑對應於使用 bun run
執行的檔案。
bun run index.ts
/path/to/index.ts
bun run foo.ts
/path/to/foo.ts
請參閱文件 > API > 工具程式以取得更多實用的工具程式。
套件管理器
設定 git 以區分 Bun 的 lockb lockfile
在 GitHub Actions 中使用 Bun 安裝相依性
讀取檔案
執行階段
串流
將 ReadableStream 轉換為 Uint8Array
將 ReadableStream 轉換為 ArrayBuffer
將 Node.js Readable 轉換為 Uint8Array
工具程式