w3resource

Yarn outdated and yarn owner CLI commands


In the previous tutorial we provided you with a guide on how to work with yarn's list, lockfile, login and logout CLI commands. The tutorial you are about to read will how to identify package dependencies that are outdated, the tutorial will also show you how to manage ownership of a package.

yarn outdated

The yarn outdated command will help you to check for packages dependencies that are outdated.

When you run the yarn outdated command from the command line, it will list the version information for all the package dependencies. This information will include the currently installed version, it also includes the desired version as well as the latest available version.

Here is an example output obtained by running yarn outdated in a tic-tac project working tree:

yarn outdated

yarn outdated [package...]

You can target one or more packages to find out their status, to do this you will need to add the package name to the end of yarn outdated as shown below:

yarn outdated package

yarn owner

This command helps you to manage the owners of a package. A package owner in a registry is a user who has access to make changes to a package. A package can have more than one owner.

An owner has the permission to perform the following tasks:

  1. An owner can publish new versions of the package
  2. He can either add or remove other owners from the package
  3. An owner can change metadata for a package

Available commands

yarn owner list <package>

This command will list all of the owners of a <package>.

yarn owner add <user> <package>

This is the command to run if you want to add a <user> as an owner of the <package>. You must be an owner of the <package> in order to run this command.

yarn owner remove <user> <package>

This command removes the <user> as an owner of the <package>. Just like the yarn owner add, you must already be an owner of the <package> in order to run this command.

Previous: Yarn list, lockfile, login and logout CLI commands
Next: The yarn pack and policies CLI commands



Follow us on Facebook and Twitter for latest update.