
Learn yarn as a reliable JavaScript dependency manager, from adding dependencies and semantic versioning to advanced topics like offline caching, yarn.lock, workspaces, monorepos, and publishing packages.
Explore what yarn is—a fast, secure, and reliable JavaScript package manager—and how yarn.lock, caching, and parallel installs address npm’s issues with inconsistent dependency versions, slow installs, and security concerns.
Set up your development environment by installing Node.js, then yarn globally via npm. Choose Visual Studio Code (or any editor) and follow platform-specific downloads for Windows, Mac, or Linux.
Initialize a yarn project to manage dependencies, generating config files and a gitignore, editorconfig, and yarn folders. Learn zero-config defaults in yarn v4 and how package.json and yarn.lock capture metadata.
Add and remove dependencies with yarn to manage packages, updating package.json and yarn.lock, as shown by Axios version 1.9.0 with a caret for semantic versioning.
Clone a project and run yarn install to fetch binaries and metadata not stored in git. If you added dependencies with yarn add yourself, you don't need yarn install.
Import and use dependencies in a yarn project by adding axios, choosing commonjs or es modules, and importing with require or import to call an API and display the response.
Mastering Yarn: semantic versioning teaches you how semver labels versions with major, minor, and patch levels, explains backward compatibility, and shows how caret, tilde, or exact versions control updates.
Yarn lock file ensures all developers use the same dependency versions by recording exact versions. The cart allows patch or minor updates, and yarn install propagates changes across devices.
Learn to update dependencies with yarn, upgrading all packages or a specific dependency using current version prefixes for patch and minor updates, and upgrade --interactive to inspect outdated packages.
Explore yarn dependency types—runtime, production bundle, development, and peer dependencies—and how to manage them in package.json using yarn add --dev.
Explore yarn scripts to automate tasks, run tests with jest, manage commands in package.json, and chain actions with && and || to build and deploy projects.
Learn how yarn caches downloaded packages locally to enable faster, offline installations by retrieving from the cache when available and automatically caching new downloads.
Yarn plug’n’play uses a local compressed cache to resolve dependencies. It bootstraps node from the cache, unlike npm's node_modules, and maps dependencies in .np and bnb.js.
Explore how yarn workspaces power monorepos, organizing multiple packages under a single repository, linking them locally via symlinks, and simplifying shared dependencies.
Configure yarn with the .yarnrc.yml file and yarn config commands to enable or disable global cache, switching between global and local caches for a project.
Create a string-utils package with two functions for capitalizing the first letter and kebab case conversion, then configure for publishing to the npm registry.
Implement the package with capitalize and kebab case, including input checks and a regex-based conversion. Export the functions, write a test, document installation in the README, and prepare publishing.
Publish package with yarn npm publish, set the access flag to public for a scoped package, login to npm with yarn login or npm login, enter otp, then re-run publish.
Publish a new package version by updating the readme with npm and yarn install instructions, then bump the patch version to 1.0.2 and publish publicly with yarn.
Install and use a published yarn package by creating a project, adding the dependency, importing, and running code that demonstrates capitalize and kebab-case transformations.
Build a monorepo task manager CLI with two packages, CLI and core, using yarn commands to add, list, and remove tasks while exploring monorepo structure and dependency management.
Set up a monorepo task manager with core and cli packages using mkdir and yarn init in a packages folder. Define workspaces in the package.json and set private to true.
Implement a core tasks manager package that reads and writes json files with fs and path, providing load, save, add, list, and remove functions for the cli in a monorepo.
Implement a yarn-based cli task manager by wiring the core dependency, handling add, list, and remove commands via process.argv in a monorepo workflow.
Yarn is a very popular and widely-used JavaScript package manager which is based on NPM. It's popularity is still increasing and currently trusted by top tech companies due to it's efficiency and reliability, and learning Yarn is definitely a valuable skill as a web developer.
In this course we are going to learn everything about Yarn starting from basics to advanced Yarn topics and package publishing.
After each section, there is a quiz that you have to solve to apply the knowledge you have gained. And in the end we are going to work on a capstone project to apply what we have learned during the course.
In this course, you will learn:
Initializing a Yarn Project
Adding and Removing Dependencies
Installing Dependencies
Importing and Using Dependencies
Semantic Versioning
Yarn Lock File
Updating Dependencies
Dependency Types
Running Scripts with Yarn
Offline Cache
Plug’n’Play (PnP)
Workspaces And Monorepos
Configuring Yarn Using .yarnrc.yml
Publishing a package to NPM
Publishing a New Version
Installing and Using the Package
In the end we are going to work on a capstone project to apply what we have learnt during the course by creating a monorepo task manager CLI tool.
Enroll now and let's step up to the next level as a web developer by mastering Yarn!