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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yarn-tool/ncu-ws

v2.0.9

Published

Workspace-aware npm-check-updates tool for Yarn workspaces. Supports monorepo dependency version checking and updating across all workspace packages with yarn.lock integration, resolutions support, and dedupe functionality. 專為 Yarn workspaces 設計的依賴版本檢查與更新

Downloads

526

Readme

@yarn-tool/ncu-ws

Workspace-aware npm-check-updates tool for Yarn workspaces. Supports monorepo dependency version checking and updating across all workspace packages.

專為 Yarn workspaces 設計的依賴版本檢查與更新工具,支援 monorepo 中所有工作區套件的版本檢查與更新。

Features / 功能特色

  • 🏢 Workspace Support - Check and update dependencies across all workspace packages
    • 批次處理所有 workspace 套件的依賴更新
  • 🔄 Batch Processing - Process all packages in a monorepo efficiently
    • 有效率地處理 monorepo 中的所有套件
  • 🔗 Yarn.lock Integration - Update yarn.lock after dependency changes
    • 在依賴變更後同步更新 yarn.lock 檔案
  • 📦 Resolutions Support - Handle package resolutions in workspaces
    • 處理 workspace 中的 resolutions 強制版本設定
  • 🎯 Dedupe Support - Remove duplicate dependencies from resolutions
    • 自動移除 resolutions 中的重複依賴
  • ⏱️ Progress Tracking - Display execution time and progress info
    • 顯示執行時間與進度資訊

Installation / 安裝

Using yarn:

yarn add @yarn-tool/ncu-ws

Using yarn-tool:

yarn-tool add @yarn-tool/ncu-ws
yt add @yarn-tool/ncu-ws

Using pnpm:

pnpm add @yarn-tool/ncu-ws

Using npm:

npm install @yarn-tool/ncu-ws

Usage / 使用方式

Programmatic API / 程式化使用

import _handleNcuArgvAuto from '@yarn-tool/ncu-ws';
import { console } from 'debug-color2';

/**
 * 建立執行時期配置物件
 * Create runtime configuration object
 */
const runtimeInput = {
  console,
  consoleDebug: console,
  printRootData: (rootData, argv) => {
    console.info(`Processing: ${rootData.root}`);
  },
};

/**
 * 執行 ncu 檢查所有 workspace 套件
 * Run ncu check across all workspace packages
 */
await _handleNcuArgvAuto(
  argv,           // yargs parsed arguments / yargs 解析後的參數
  runtimeInput,   // runtime configuration / 執行時期配置
  true,           // isWorkspace: enable workspace mode / 啟用 workspace 模式
  true            // includeRoot: include root package.json / 包含根套件
);

CLI Integration / 命令列整合

This package is designed to be used as part of yarn-tool CLI: 此套件設計為 yarn-tool CLI 的一部分:

# Check for updates in all workspace packages
# 檢查所有 workspace 套件的更新
yarn-tool ncu

# Check and update all workspace packages
# 檢查並更新所有 workspace 套件
yarn-tool ncu -u

# Check with specific options
# 使用特定選項檢查
yarn-tool ncu --filter "typescript" --dep dev

How It Works / 運作方式

  1. Find Workspace Root / 尋找 Workspace 根目錄

    • Locates the workspace root directory
    • 定位 workspace 根目錄位置
  2. List Workspace Packages / 列出 Workspace 套件

    • Enumerates all packages in the workspace
    • 列舉 workspace 中的所有套件
  3. Process Each Package / 處理每個套件

    • Runs npm-check-updates on each package.json
    • 對每個 package.json 執行 npm-check-updates
  4. Update yarn.lock / 更新 yarn.lock

    • Synchronizes yarn.lock with package changes
    • 將 yarn.lock 與套件變更同步
  5. Handle Resolutions / 處理 Resolutions

    • Updates root resolutions if needed
    • 在需要時更新根套件的 resolutions

API Reference / API 參考

_handleNcuArgvAuto(argv, runtimeInput, isWorkspace?, includeRoot?)

Main function to process ncu across workspaces. 處理跨 workspaces 的 ncu 主要函數。

Parameters / 參數:

| Parameter | Type | Description | |-----------|------|-------------| | argv | IArgvRuntime | Parsed yargs arguments with ncu options / 解析後的 yargs 參數 | | runtimeInput | IRuntimeInput | Runtime configuration object / 執行時期配置物件 | | isWorkspace | boolean | Enable workspace mode (default: false) / 啟用 workspace 模式 | | includeRoot | boolean | Include root package.json (default: false) / 包含根套件 |

RuntimeInput Properties / 執行時期配置屬性:

| Property | Type | Description | |----------|------|-------------| | console | Console2 | Console instance for output / 輸出用的控制台實例 | | consoleDebug | Console2 | Console instance for debug output / 除錯輸出的控制台實例 | | printRootData | function | Callback to print root data / 輸出根資料的回呼函數 |

Returns / 回傳: Promise<void>

IArgvRuntime

Type for parsed command line arguments. Extends the base ncu options with workspace-specific flags: 解析後的命令列參數類型,擴展基礎 ncu 選項並加入 workspace 特定旗標:

| Option | Description | |--------|-------------| | AA | Auto-enable workspace mode with root inclusion / 自動啟用 workspace 模式並包含根套件 | | resolutions | Process resolutions instead of dependencies / 處理 resolutions 而非依賴 | | dedupe | Remove duplicate dependencies from resolutions / 從 resolutions 移除重複依賴 | | upgrade | Apply updates to package.json / 將更新套用到 package.json | | filter | Filter packages by name pattern / 依名稱模式篩選套件 |

Related Packages / 相關套件

License / 授權

ISC