Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

yarn-tool

bluelovers1kISC2.1.4TypeScript support: included

yarn cli tool helper

cli, data deduplication, dedupe, deduplicate, deduplication, diff, duplicated, install, lerna, lockfile, npm, package, package manager, packages, project, tool, workspace, workspaces, ws, yarn, yarn-tool, yarn.lock

readme

README

a yarn cli tool helper

install

npm install

recommend use npx way

npm install -g yarn-tool yarn

u can use alias name yt instead of yarn-tool, when installed

yt <command> 

npx

npx yarn-tool <command> 

Usage

help

yt --help
yt <cmd> --help

$ yarn-tool --help
yt <command>

Commands:
  yt add [name]     Installs a package
  yt bin            Get the path to a binary script.
  yt create         create a npm package or update package.json file
  yt dedupe [cwd]   package deduplication for yarn.lock             [aliases: d]
  yt dlx            Run a package in a temporary environment. require yarn
                    version >= 2
  yt init           create a npm package or update package.json file
  yt install [cwd]  do dedupe with yarn install                     [aliases: i]
  yt link           Symlink a package folder during development.
  yt list           List installed packages.
  yt lockfile       show yarn.lock info
  yt ncu [-u]       Find newer versions of dependencies than what your
                    package.json allows                        [aliases: update]
  yt node           Run node with the hook already setup.
  yt pack           Creates a compressed gzip archive of package dependencies.
  yt publish        publish a npm package                        [aliases: push]
  yt remove         Running yarn remove foo will remove the package named foo
                    from your direct dependencies updating your package.json and
                    yarn.lock files in the process.                [aliases: rm]
  yt run            Runs a defined package script.
  yt sort           sort package.json file
  yt test           Runs the test script defined by the package.
  yt types [name]   Installs @types/* of packages if not exists in package.json
  yt unlink         To remove a symlinked package created with yarn link, yarn
                    unlink can be used.
  yt unplug         Temporarily copies a package (with an optional @range
                    suffix) outside of the global cache for debugging purposes
                                                                 [aliases: upnp]
  yt upgrade        Symlink a package folder during development.
                                                          [aliases: upgrade, up]
  yt versions       Displays version information of the currently installed
                    Yarn, Node.js, and its dependencies.
  yt why            Show information about why a package is installed.
  yt ws <cmd>       yarn workspaces         [aliases: ws, workspaces, workspace]

Options:
  --cwd                 current working directory or package directory
                                                [string] [default: "G:\Users\The
              Project\nodejs-yarn\ws-create-yarn-workspaces\packages\yarn-tool"]
  --skipCheckWorkspace  this options is for search yarn.lock, pkg root,
                        workspace root, not same as
                        --ignore-workspace-root-check                  [boolean]
  --yt-debug-mode                                                      [boolean]
  -v, --version         Show version number                            [boolean]
  -h, --help            Show help                                      [boolean]

yt ws

yt ws <cmd>

yarn workspaces

命令:
  yt ws add     Installs a package in workspaces.
  yt ws info    Show information about your workspaces.
  yt ws init    create yarn workspaces
  yt ws remove  Remove a package in workspaces.
  yt ws run     run script by lerna
  yt ws exec    Execute an arbitrary command in each package

yt ncu

yt ncu [-u]

Find newer versions of dependencies than what your package.json or bower.json
allows

選項:
  --version             顯示版本                                          [布林]
  --cwd                 current working directory or package directory
                                                   [字串] [預設值: "G:\Users\The
              Project\nodejs-yarn\ws-create-yarn-workspaces\packages\yarn-tool"]
  --skipCheckWorkspace  this options is for search yarn.lock, pkg root,
                        workspace root, not same as
                        --ignore-workspace-root-check                     [布林]
  --yt-debug-mode                                                         [布林]
  --help                顯示說明                                          [布林]
  --dep                 check only a specific section(s) of dependencies:
                        prod|dev|peer|optional|bundle (comma-delimited)   [字串]
  --minimal, -m         do not upgrade newer versions that are already satisfied
                        by the version range according to semver          [布林]
  --newest, -n          find the newest versions available instead of the latest
                        stable versions                                   [布林]
  --packageManager, -p  npm (default) or bower            [字串] [預設值: "npm"]
  --registry, -r        specify third-party npm registry                  [字串]
  --silent, -s          don't output anything (--loglevel silent)         [布林]
  --greatest, -g        find the highest versions available instead of the
                        latest stable versions                            [布林]
  --upgrade, -u         overwrite package file                            [布林]
  --semverLevel         find the highest version within "major" or "minor"[字串]
  --removeRange         remove version ranges from the final package version
                                                                          [布林]
  --dedupe              remove upgrade module from resolutions
                                                           [布林] [預設值: true]

yt add

yt add [name]

Installs a package

選項:
  --version                          顯示版本                             [布林]
  --cwd                              current working directory or package
                                     directory     [字串] [預設值: "G:\Users\The
              Project\nodejs-yarn\ws-create-yarn-workspaces\packages\yarn-tool"]
  --skipCheckWorkspace               this options is for search yarn.lock, pkg
                                     root, workspace root, not same as
                                     --ignore-workspace-root-check        [布林]
  --yt-debug-mode                                                         [布林]
  --help                             顯示說明                             [布林]
  --dev, -D                          install packages to devDependencies. [布林]
  --peer, -P                         install packages to peerDependencies.[布林]
  --optional, -O                     install packages to optionalDependencies.
                                                                          [布林]
  --exact, -E                        see
                                     https://yarnpkg.com/lang/en/docs/cli/add/
                                                                          [布林]
  --tilde, -T                        see
                                     https://yarnpkg.com/lang/en/docs/cli/add/
                                                                          [布林]
  --audit                            see
                                     https://yarnpkg.com/lang/en/docs/cli/add/
                                                                          [布林]
  --name                                                           [字串] [必須]
  --dedupe, -d                       Data deduplication for yarn.lock
                                                           [布林] [預設值: true]
  --ignore-workspace-root-check, -W  see
                                     https://yarnpkg.com/lang/en/docs/cli/add/
                                                                          [布林]
  --types, --type                    try auto install @types/* too        [布林]

install

this same as yarn, but will do dedupe

npx yarn-tool install

dedupe

Data deduplication for yarn.lock

npx yarn-tool dedupe
npx yarn-tool dedupe C:/xxxx/packages/name
npx yarn-tool dedupe .

add

this same as yarn add [name], but will do dedupe before install by default

npx yarn-tool add @bluelovers/tsconfig -D

help

Show help

npx yarn-tool help
npx yarn-tool --help

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.1.3 (2024-03-01)

Note: Version bump only for package yarn-tool

2.1.2 (2024-03-01)

Note: Version bump only for package yarn-tool

2.0.1 (2023-10-10)

🐛 Bug Fixes

  • style: use @yarn-tool/write-package-json (c7f4612)

🔖 Miscellaneous

1.4.18 (2023-01-24)

Note: Version bump only for package yarn-tool

1.4.17 (2022-12-09)

Note: Version bump only for package yarn-tool

1.4.16 (2022-11-05)

⚙️ Continuous Integration

🔖 Miscellaneous

1.4.15 (2022-10-28)

Note: Version bump only for package yarn-tool

1.4.14 (2022-10-01)

Note: Version bump only for package yarn-tool

1.4.13 (2022-09-30)

Note: Version bump only for package yarn-tool

1.4.12 (2022-09-29)

Note: Version bump only for package yarn-tool

1.4.11 (2022-09-28)

Note: Version bump only for package yarn-tool

1.4.10 (2022-09-27)

Note: Version bump only for package yarn-tool

1.4.9 (2022-09-22)

Note: Version bump only for package yarn-tool

1.4.8 (2022-09-12)

Note: Version bump only for package yarn-tool

1.4.7 (2022-09-10)

Note: Version bump only for package yarn-tool

1.4.6 (2022-09-06)

Note: Version bump only for package yarn-tool

1.4.5 (2022-08-28)

✨ Features

1.4.4 (2022-08-26)

Note: Version bump only for package yarn-tool

1.4.3 (2022-08-26)

🐛 Bug Fixes

✨ Features

📦 Code Refactoring

1.4.2 (2022-08-26)

Note: Version bump only for package yarn-tool

1.4.1 (2022-08-20)

Note: Version bump only for package yarn-tool

1.3.5 (2022-08-19)

Note: Version bump only for package yarn-tool

1.3.4 (2022-08-18)

Note: Version bump only for package yarn-tool

1.3.3 (2022-08-15)

Note: Version bump only for package yarn-tool

1.3.2 (2022-08-15)

Note: Version bump only for package yarn-tool

1.3.1 (2022-08-13)

📦 Code Refactoring

📌 Dependencies

BREAKING CHANGES

  • update deps

1.2.64 (2022-07-29)

Note: Version bump only for package yarn-tool

1.2.63 (2022-07-29)

✨ Features

  • ncu: 優化 ncu 指令並且支援直接處理 workspace 下所有 package (84fc99b)

BREAKING CHANGES

  • ncu: 優化 ncu 指令並且支援直接處理 workspace 下所有 package

1.2.62 (2022-07-14)

Note: Version bump only for package yarn-tool

1.2.61 (2022-07-14)

Note: Version bump only for package yarn-tool

1.2.60 (2022-07-07)

♻️ Dependencies

1.2.59 (2022-06-28)

♻️ Dependencies

1.2.58 (2022-05-11)

Note: Version bump only for package yarn-tool

1.2.57 (2022-03-16)

Note: Version bump only for package yarn-tool

1.2.56 (2022-03-14)

Note: Version bump only for package yarn-tool

1.2.55 (2022-02-20)

Note: Version bump only for package yarn-tool

1.2.54 (2022-02-19)

Note: Version bump only for package yarn-tool

1.2.53 (2022-02-12)

Note: Version bump only for package yarn-tool

1.2.52 (2022-02-05)

Note: Version bump only for package yarn-tool

1.2.51 (2022-02-01)

Note: Version bump only for package yarn-tool

1.2.50 (2022-02-01)

Note: Version bump only for package yarn-tool

1.2.49 (2022-01-31)

Note: Version bump only for package yarn-tool

1.2.48 (2022-01-28)

Note: Version bump only for package yarn-tool

1.2.47 (2022-01-25)

Note: Version bump only for package yarn-tool

1.2.46 (2022-01-13)

Note: Version bump only for package yarn-tool

1.2.45 (2022-01-02)

Note: Version bump only for package yarn-tool

1.2.44 (2022-01-01)

Note: Version bump only for package yarn-tool

1.2.43 (2022-01-01)

Note: Version bump only for package yarn-tool

1.2.42 (2021-12-31)

Note: Version bump only for package yarn-tool

1.2.41 (2021-12-30)

Note: Version bump only for package yarn-tool

1.2.40 (2021-12-29)

Note: Version bump only for package yarn-tool

1.2.39 (2021-12-29)

✨ Features

  • auto check/fix workspaces/package (cc3ecb4)

1.2.38 (2021-12-27)

✨ Features

1.2.37 (2021-12-27)

Note: Version bump only for package yarn-tool

1.2.36 (2021-12-27)

Note: Version bump only for package yarn-tool

1.2.35 (2021-12-27)

Note: Version bump only for package yarn-tool

1.2.34 (2021-12-26)

Note: Version bump only for package yarn-tool

1.2.33 (2021-12-26)

Note: Version bump only for package yarn-tool

1.2.32 (2021-12-26)

Note: Version bump only for package yarn-tool

1.2.31 (2021-12-26)

Note: Version bump only for package yarn-tool

1.2.30 (2021-12-19)

Note: Version bump only for package yarn-tool

1.2.29 (2021-12-17)

Note: Version bump only for package yarn-tool

1.2.28 (2021-12-16)

Note: Version bump only for package yarn-tool

1.2.27 (2021-12-08)

Note: Version bump only for package yarn-tool

1.2.26 (2021-12-08)

🐛 Bug Fixes

1.2.25 (2021-12-08)

✨ Features

1.2.24 (2021-12-07)

Note: Version bump only for package yarn-tool

1.2.23 (2021-12-07)

Note: Version bump only for package yarn-tool

1.2.22 (2021-12-06)

Note: Version bump only for package yarn-tool

1.2.21 (2021-12-06)

Note: Version bump only for package yarn-tool

1.2.20 (2021-12-06)

✨ Features

  • support update scope setting (83aaa7b)

1.2.19 (2021-11-30)

Note: Version bump only for package yarn-tool

1.2.18 (2021-11-28)

♻️ Chores

1.2.17 (2021-11-23)

Note: Version bump only for package yarn-tool

1.2.16 (2021-11-08)

Note: Version bump only for package yarn-tool

1.2.15 (2021-10-27)

♻️ Chores

1.2.14 (2021-10-13)

Note: Version bump only for package yarn-tool

1.2.13 (2021-09-21)

🐛 Bug Fixes

  • avoid wmic failed windows 10 (cd76b51)

🔖 Miscellaneous

1.2.12 (2021-09-15)

Note: Version bump only for package yarn-tool

1.2.11 (2021-08-20)

Note: Version bump only for package yarn-tool

1.2.10 (2021-08-20)

🐛 Bug Fixes

1.2.8 (2021-08-14)

✨ Features

  • bin: global -W (3042359)
  • root: lazy support other cmd (1c8cc27)
  • ws: add ws sort - sort each package.json file in workspaces (50529ad)

♻️ Chores

1.2.7 (2021-07-24)

Note: Version bump only for package yarn-tool

1.2.6 (2021-07-24)

🐛 Bug Fixes

  • 修正當 不存在 workspaces 時,初始化 會判定錯誤的問題 (9549ce8)

1.2.5 (2021-07-24)

Note: Version bump only for package yarn-tool

1.2.4 (2021-07-23)

📦 Code Refactoring

  • yt ws add 的執行方式 改為 lerna add 而非 yarn add -W (b9d4210)

♻️ Chores

BREAKING CHANGE

  • yt ws add 的執行方式 改為 lerna add 而非 yarn add -W

1.2.3 (2021-07-16)

Note: Version bump only for package yarn-tool

1.2.2 (2021-07-13)

Note: Version bump only for package yarn-tool

1.2.1 (2021-07-11)

🐛 Bug Fixes

🛠 Build System

  • update deps and use tslib (cd7128c)

1.1.8 (2021-06-22)

🐛 Bug Fixes

  • only print message when updated (378fea9)

1.1.7 (2021-06-21)

🐛 Bug Fixes

  • 沒有執行 add 時忽略多餘的 dedupe 步驟 (1606f87)

✨ Features

1.1.6 (2021-06-07)

♻️ Chores

1.0.150 (2021-02-08)

✨ Features

  • install: add --reset-lockfile for ignore and reset yarn.lock lockfile (5328722)

♻️ Chores

🔖 Miscellaneous

1.0.146 (2020-09-23)

Note: Version bump only for package yarn-tool

1.0.145 (2020-09-04)

Note: Version bump only for package yarn-tool

1.0.144 (2020-09-04)

Note: Version bump only for package yarn-tool

1.0.143 (2020-09-04)

🐛 Bug Fixes

1.0.142 (2020-09-04)

🐛 Bug Fixes

  • 修正直接從 工作區內新增 deps 後 導致安裝列表為空 而導致出錯 (0de2ee2)

1.0.141 (2020-08-19)

✨ Features

  • support direct add deps from workspaces (ff4bcfe)

1.0.140 (2020-08-17)

✨ Features

📦 Code Refactoring

  • use @yarn-tool/pkg-deps-util (9241d95)

1.0.139 (2020-08-13)

Note: Version bump only for package yarn-tool

1.0.138 (2020-08-12)

🐛 Bug Fixes

  • 修正 yarn.lock 沒有正確轉換的問題 (92ba4e3)

1.0.137 (2020-08-12)

✨ Features

  • support update tag version in yarn.lock (4279eed)

1.0.136 (2020-08-11)

Note: Version bump only for package yarn-tool

1.0.135 (2020-08-10)

Note: Version bump only for package yarn-tool

1.0.134 (2020-08-08)

Note: Version bump only for package yarn-tool

1.0.132 (2020-08-06)

Note: Version bump only for package yarn-tool

1.0.131 (2020-08-06)

Note: Version bump only for package yarn-tool

1.0.130 (2020-08-06)

✨ Features

  • bump version support interactive mode (19c9f03)

1.0.129 (2020-08-02)

✨ Features

  • bump version of package (f9945a9)

1.0.128 (2020-08-01)

Note: Version bump only for package yarn-tool

1.0.126 (2020-08-01)

Note: Version bump only for package yarn-tool

1.0.125 (2020-07-31)

Note: Version bump only for package yarn-tool

1.0.124 (2020-07-30)

Note: Version bump only for package yarn-tool

1.0.123 (2020-07-28)

Note: Version bump only for package yarn-tool

1.0.122 (2020-07-27)

Note: Version bump only for package yarn-tool

1.0.121 (2020-07-26)

Note: Version bump only for package yarn-tool

1.0.120 (2020-07-24)

Note: Version bump only for package yarn-tool

1.0.119 (2020-07-19)

Note: Version bump only for package yarn-tool

1.0.118 (2020-07-19)

Note: Version bump only for package yarn-tool

1.0.117 (2020-07-19)

Note: Version bump only for package yarn-tool

1.0.116 (2020-07-19)

Note: Version bump only for package yarn-tool

1.0.115 (2020-07-18)

Note: Version bump only for package yarn-tool

1.0.114 (2020-07-12)

Note: Version bump only for package yarn-tool

1.0.113 (2020-07-12)

Note: Version bump only for package yarn-tool

1.0.112 (2020-07-05)

Note: Version bump only for package yarn-tool

1.0.111 (2020-07-04)

Note: Version bump only for package yarn-tool

1.0.110 (2020-07-03)

Note: Version bump only for package yarn-tool

1.0.109 (2020-06-27)

Note: Version bump only for package yarn-tool

1.0.108 (2020-06-26)

Note: Version bump only for package yarn-tool

1.0.107 (2020-06-23)

✨ Features

  • support empty yarn.lock (32a793b)

🛠 Build System

1.0.106 (2020-06-23)

Note: Version bump only for package yarn-tool

1.0.105 (2020-06-23)

Note: Version bump only for package yarn-tool

1.0.104 (2020-06-20)

Note: Version bump only for package yarn-tool

1.0.103 (2020-06-19)

Note: Version bump only for package yarn-tool

1.0.101 (2020-06-17)

Note: Version bump only for package yarn-tool

1.0.100 (2020-06-16)

Note: Version bump only for package yarn-tool

1.0.99 (2020-06-16)

Note: Version bump only for package yarn-tool

1.0.98 (2020-06-16)

Note: Version bump only for package yarn-tool

1.0.97 (2020-06-16)

♻️ Chores

1.0.96 (2020-06-15)

Note: Version bump only for package yarn-tool

1.0.95 (2020-06-15)

♻️ Chores

🐛 Bug Fixes

  • Error: Cannot find module 'debug-color2' (690d8a3)
  • ...process.env, (ce46493)
  • bug of list with new yargs (7f1629b)
  • 防止 yarn.lock 不存在 導致 ncu 失敗 (65da26a)
  • 修正路徑載入問題 (0d91802)
  • 修正執行 ncu 時 resolutions 不存在導致的錯誤 (a9916ad)

✨ Features

  • try set NO_UPDATE_NOTIFIER=1 (c06151f)
  • use @yarn-tool/ncu (d9a294c)
  • use @yarn-tool/yarnlock (a400d8f)
  • run/exec in workspaces root (e6e9f8a)
  • use sort-package-json3 (129bd66)
  • support create npm-shrinkwrap (4301358)

Miscellaneous

1.0.94 (2020-06-15)

♻️ Chores

🐛 Bug Fixes

  • Error: Cannot find module 'debug-color2' (690d8a3)
  • ...process.env, (ce46493)
  • bug of list with new yargs (7f1629b)
  • 防止 yarn.lock 不存在 導致 ncu 失敗 (65da26a)
  • 修正路徑載入問題 (0d91802)
  • 修正執行 ncu 時 resolutions 不存在導致的錯誤 (a9916ad)

✨ Features

  • try set NO_UPDATE_NOTIFIER=1 (c06151f)
  • use @yarn-tool/ncu (d9a294c)
  • use @yarn-tool/yarnlock (a400d8f)
  • run/exec in workspaces root (e6e9f8a)
  • use sort-package-json3 (129bd66)
  • support create npm-shrinkwrap (4301358)

Miscellaneous

1.0.93 (2020-06-15)

🐛 Bug Fixes

  • Error: Cannot find module 'debug-color2' (690d8a3)
  • ...process.env, (ce46493)
  • bug of list with new yargs (7f1629b)
  • 防止 yarn.lock 不存在 導致 ncu 失敗 (65da26a)
  • 修正路徑載入問題 (0d91802)
  • 修正執行 ncu 時 resolutions 不存在導致的錯誤 (a9916ad)

♻️ Chores

✨ Features

  • try set NO_UPDATE_NOTIFIER=1 (c06151f)
  • use @yarn-tool/ncu (d9a294c)
  • use @yarn-tool/yarnlock (a400d8f)
  • run/exec in workspaces root (e6e9f8a)
  • use sort-package-json3 (129bd66)
  • support create npm-shrinkwrap (4301358)

Miscellaneous