Workspace
ELI5 — The Vibe Check
A workspace is how package managers understand a monorepo — they see multiple packages inside one repo and manage them together. Set up workspaces and you can run a command once from the root and it applies to all the packages inside.
Real Talk
Workspaces are a package manager feature (npm workspaces, yarn workspaces, pnpm workspaces) that enables managing multiple packages within a single repository. They hoist shared dependencies and allow cross-package references during development.
Show Me The Code
// package.json root in a monorepo
{
"name": "my-monorepo",
"workspaces": [
"packages/frontend",
"packages/backend",
"packages/shared"
]
}
When You'll Hear This
"Add the new package to the workspaces array in the root package.json." / "Workspace hoisting can cause peer dependency issues — watch out."
Related Terms
Dependency
A dependency is a package your project relies on to work. Your app depends on React to render UI, axios to make requests, and dotenv to read config.
Monorepo
A monorepo is when you put all your different projects — frontend, backend, shared libraries — in one giant single repository instead of separate repos.
node_modules
node_modules is the folder where npm dumps all the packages you install. It can grow to hundreds of megabytes instantly and contains thousands of files.
Package
A package is a bundle of code someone else wrote and published so you don't have to reinvent the wheel. Need to parse dates? There's a package for that.