Bun

bun outdated

使用 bun outdated 來檢查專案中過時的依賴項。此命令會顯示一個表格,列出有較新版本的依賴項。

$bun outdated
bun outdated v1.2.5
套件
目前版本
可更新版本
最新版本
@sinclair/typebox
0.34.15
0.34.16
0.34.16
@types/bun (開發依賴項)
1.2.0
1.2.5
1.2.5
eslint (開發依賴項)
8.57.1
8.57.1
9.20.0
eslint-plugin-security (開發依賴項)
2.1.1
2.1.1
3.0.1
eslint-plugin-sonarjs (開發依賴項)
0.23.0
0.23.0
3.0.1
expect-type (開發依賴項)
0.16.0
0.16.0
1.1.0
prettier (開發依賴項)
3.4.2
3.5.0
3.5.0
tsup (開發依賴項)
8.3.5
8.3.6
8.3.6
typescript (開發依賴項)
5.7.2
5.7.3
5.7.3

版本資訊

輸出表格顯示三個版本欄位

  • 目前版本: 目前安裝的版本
  • 可更新版本: 符合您的 package.json 版本範圍的最新版本
  • 最新版本: 發布到 registry 的最新版本

依賴項篩選器

bun outdated 支援透過套件名稱和 glob 模式搜尋過時的依賴項。

若要檢查特定依賴項是否過時,請將套件名稱作為位置引數傳遞

$bun outdated eslint-plugin-security eslint-plugin-sonarjs
bun outdated v1.2.5
套件
目前版本
可更新版本
最新版本
eslint-plugin-security (開發依賴項)
2.1.1
2.1.1
3.0.1
eslint-plugin-sonarjs (開發依賴項)
0.23.0
0.23.0
3.0.1

您也可以傳遞 glob 模式來檢查過時的套件

$bun outdated 'eslint*'
bun outdated v1.2.5
套件
目前版本
可更新版本
最新版本
eslint (開發依賴項)
8.57.1
8.57.1
9.20.0
eslint-plugin-security (開發依賴項)
2.1.1
2.1.1
3.0.1
eslint-plugin-sonarjs (開發依賴項)
0.23.0
0.23.0
3.0.1

例如,要檢查過時的 @types/* 套件

$bun outdated '@types/*'
bun outdated v1.2.5
套件
目前版本
可更新版本
最新版本
@types/bun (開發依賴項)
1.2.0
1.2.5
1.2.5

或者排除所有 @types/* 套件

$bun outdated '!@types/*'
bun outdated v1.2.5
套件
目前版本
可更新版本
最新版本
@sinclair/typebox
0.34.15
0.34.16
0.34.16
eslint (開發依賴項)
8.57.1
8.57.1
9.20.0
eslint-plugin-security (開發依賴項)
2.1.1
2.1.1
3.0.1
eslint-plugin-sonarjs (開發依賴項)
0.23.0
0.23.0
3.0.1
expect-type (開發依賴項)
0.16.0
0.16.0
1.1.0
prettier (開發依賴項)
3.4.2
3.5.0
3.5.0
tsup (開發依賴項)
8.3.5
8.3.6
8.3.6
typescript (開發依賴項)
5.7.2
5.7.3
5.7.3

工作區篩選器

使用 --filter 標記來檢查不同工作區套件中過時的依賴項

$bun outdated --filter='@monorepo/types'
bun outdated v1.2.5
套件
目前版本
可更新版本
最新版本
tsup (開發依賴項)
8.3.5
8.3.6
8.3.6
typescript (開發依賴項)
5.7.2
5.7.3
5.7.3

您可以傳遞多個 --filter 標記來檢查多個工作區。

$bun outdated --filter @monorepo/types --filter @monorepo/cli
bun outdated v1.2.5
套件
目前版本
可更新版本
最新版本
eslint (開發依賴項)
8.57.1
8.57.1
9.20.0
eslint-plugin-security (開發依賴項)
2.1.1
2.1.1
3.0.1
eslint-plugin-sonarjs (開發依賴項)
0.23.0
0.23.0
3.0.1
expect-type (開發依賴項)
0.16.0
0.16.0
1.1.0
tsup (開發依賴項)
8.3.5
8.3.6
8.3.6
typescript (開發依賴項)
5.7.2
5.7.3
5.7.3

您也可以傳遞 glob 模式來依工作區名稱篩選。

$bun outdated --filter='@monorepo/{types,cli}'
bun outdated v1.2.5
套件
目前版本
可更新版本
最新版本
eslint (開發依賴項)
8.57.1
8.57.1
9.20.0
eslint-plugin-security (開發依賴項)
2.1.1
2.1.1
3.0.1
eslint-plugin-sonarjs (開發依賴項)
0.23.0
0.23.0
3.0.1
expect-type (開發依賴項)
0.16.0
0.16.0
1.1.0
tsup (開發依賴項)
8.3.5
8.3.6
8.3.6
typescript (開發依賴項)
5.7.2
5.7.3
5.7.3

命令列介面用法

$bun outdated filter

選項

設定

-c,--config=<val>
指定設定檔路徑 (bunfig.toml)
--registry=<val>
預設使用特定的 registry,覆寫 .npmrc、bunfig.toml 和環境變數。

鎖定檔管理

-y,--yarn
寫入 yarn.lock 檔案 (yarn v1)
--no-save
不要更新 package.json 或儲存鎖定檔
--save
儲存到 package.json (預設為 true)
--frozen-lockfile
不允許變更鎖定檔
--save-text-lockfile
儲存基於文字的鎖定檔
--lockfile-only
產生鎖定檔但不安裝依賴項

依賴項管理

-p,--production
不要安裝 devDependencies
-f,--force
總是從 registry 請求最新版本並重新安裝所有依賴項
--ignore-scripts
跳過專案 package.json 中的生命週期腳本 (永遠不會執行依賴項腳本)
--trust
新增到專案 package.json 中的 trustedDependencies 並安裝套件
--omit=<val>
從安裝中排除 'dev'、'optional' 或 'peer' 依賴項

快取和驗證

--cache-dir=<val>
從特定目錄路徑儲存和載入快取資料
--no-cache
完全忽略 manifest 快取
--no-verify
跳過驗證新下載套件的完整性

日誌記錄和輸出

--silent
不要記錄任何內容
--verbose
過於詳細的日誌記錄
--no-progress
停用進度條
--no-summary
不要列印摘要

安裝行為

--dry-run
不要安裝任何東西
--concurrent-scripts=<val>
生命週期腳本的最大並行任務數 (預設為 5)
--network-concurrency=<val>
最大並行網路請求數 (預設為 48)
--backend=<val>
安裝依賴項的平台特定最佳化。可能的值:"clonefile" (預設值)、"hardlink"、"symlink"、"copyfile"

安全性和憑證

--ca=<val>
提供憑證授權單位簽署憑證
--cafile=<val>
與 `--ca` 相同,但為憑證的檔案路徑

安裝範圍

-g,--global
全域安裝
--cwd=<val>
設定特定的 cwd

說明

-h,--help
列印此說明選單

篩選

-F,--filter=<val>
顯示每個符合工作區的過時依賴項

範例

顯示目前工作區中過時的依賴項。
bun outdated
使用 --filter 來包含多個工作區。
bun outdated --filter="*"
bun outdated --filter="./app/*"
使用名稱模式篩選依賴項。
bun outdated jquery
bun outdated "is-*"