Skip to content

Yarn2 - things to know

What's new in Yarn - a short course on egghead.io

Written by Eva Dee on (about a 1 minute read).

What is Yarn Plug'n'Play (PnP?)

It's a feature of yarn 2 and it saves up space and installation time by getting rid of your projects node_modules in favor of a .pnp.js file. The .pnp.js file points to the location of where the packages are installed (.yarn file in your project's home directory).

  • yarn dlx

Is the counterpart to npx and allows you to run packages without installing them locally (only in yarn 2).

  • yarn up -i [package]

Yarn 2 is aware of workspaces. Using interactive upgrade, if you have more than one project in the workspace and the same package is used (e.g. React), you'll be able to choose whether you want to upgrade or keep the package.

Note to self: make sure to escape quotation marks, apostrophe etc in the yaml frontmatter.