Yarn plugin to show outdated dependencies.
yarn plugin import https://go.mskelton.dev/yarn-outdated/v4
yarn plugin import https://go.mskelton.dev/yarn-outdated/v3
yarn plugin import https://go.mskelton.dev/yarn-outdated/v1.2.0
When run without arguments, this plugin will find outdated plugins in all workspaces of your project.
yarn outdated
You can easily filter dependencies using any valid micromatch glob pattern. This is especially useful when you want to check a set of related dependencies such as a component library or tools such as Babel or ESLint.
yarn outdated '@babel/*'
And, in case you were wondering, you can add multiple glob patterns!
yarn outdated '@babel/*' '@types/*'
In addition to filtering dependencies, larger projects will find it very helpful to filter workspaces so only outdated dependencies in a set of workspaces will be included.
The simplest way to filter a workspace is by it's name. And just like dependency filtering, this flag supports glob patterns!
yarn outdated --workspace frontend
You can also filter workspaces by directory using either an absolute or relative path.
yarn outdated --workspace packages/a
yarn outdated --workspace /Users/mark/project/packages/a
The --workspace
flag can be added multiple times to specify multiple glob
patterns to match with. You can even mix and match directories and workspace
names!
yarn outdated --workspace packages/a --workspace frontend
Tip: Specifying --workspace .
will use the current working directory.
It's not always possible to update to the latest major version, and likewise you
may not care about every single patch release to packages. Don't worry, we've
got your back! With the --severity
option, you can specify which severity
levels to include. By default, we show all but if you only want to display minor
versions updates, you could use this command.
yarn outdated --severity minor
Also, this flag can be specified multiple times if you would like to include multiple severities, such as minor and patch versions, as shown in the following example.
yarn outdated --severity minor --severity patch
The final means of filtering outdated dependencies is by dependency type. For
example, to only display outdated devDependencies
, use the following command.
yarn outdated --type devDependencies
By default, only the latest version of dependencies are displayed. However, in some cases you may wish to know both the latest version and the version that satisfies the range specified in your manifest.
yarn outdated --range
For example if you have "glob": "^7.2.0"
in your manifest, the output with
this flag might look something like this.
➤ YN0000: Package Current Range Latest Package Type
➤ YN0000: glob 7.2.0 7.2.3 8.0.3 devDependencies
By default, this plugin will always return an exit code 0 even if there are
outdated dependencies. While this is perfect for normal use, if you want to use
this plugin with scripts and fail if there are outdated dependencies, you can
add the --check
flag.
yarn outdated --check
It is possible to display dependency homepage URLs in the output. To do so,
simply add the --url
flag to the command!
yarn outdated --url
In addition to the standard terminal text format, this plugin supports JSON and markdown formatting.
If you are writing a script that depends on information from this plugin, you
may find the --format=json
option helpful to get raw JSON data that you can
then parse and use as your needs require.
If you are using this plugin in a GitHub action or other CI provider that
displays markdown content, use --format=markdown
to display a formatted
markdown table.
By default, homepage URLs are not included in the output. In addition to the
--url
flag, you can configure URLs to show by default.
outdatedIncludeUrl: true
When this setting is enabled, you can use the --no-url
flag to disable it on a
per-command basis.
yarn outdated --no-url