The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.
Nx is a build system and toolkit designed to manage monorepos containing multiple JavaScript and TypeScript projects. It addresses the complexity of coordinating builds, tests, and deployments across interconnected applications and libraries by introducing intelligent task orchestration, computation caching, and dependency graph analysis. When you modify code in a monorepo, Nx determines which projects are affected and runs only the necessary tasks, skipping work that hasn't changed based on content-addressable cache keys.
The package serves as the core foundation for Nx workspaces, providing CLI commands, project graph construction, and task runners that work across frameworks like Angular, React, Node.js, and Nest. It uses a plugin architecture where framework-specific functionality is added through additional packages (like @nx/angular or @nx/react), but the core nx package handles the fundamental monorepo mechanics. This separation allows teams to adopt Nx incrementally by running npx nx@latest init in existing repositories without restructuring.
Nx is used by development teams managing multiple related applications—such as a company maintaining customer-facing web apps, mobile backends, and shared component libraries. It's particularly valuable when you need consistent tooling configurations across projects, want to avoid rebuilding unchanged code in CI pipelines, or need to visualize how architectural changes propagate through dependencies. With over 8.6 million weekly downloads, it's become a standard solution for teams outgrowing single-project workflows or dealing with the coordination overhead of traditional monorepo tools like Lerna.
// nx.json - Configure caching and task dependencies
{
"targetDefaults": {
"build": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
}
}
}
// apps/web-app/project.json - Define project tasks
{
"name": "web-app",
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"outputs": ["{workspaceRoot}/dist/apps/web-app"],
"options": {
"outputPath": "dist/apps/web-app",
"main": "apps/web-app/src/main.ts"
}
}
}
}
// Terminal commands - Common Nx workflows
// Build only projects affected by changes since main branch
npx nx affected:build --base=origin/main --head=HEAD
// Run tests for a specific project with caching
npx nx test web-app
// Generate a new library with code generator
npx nx g @nx/js:library shared-utils --directory=libs/shared-utils
// Visualize project dependencies in browser
npx nx graph
// Release packages with version bump and changelog
npx nx release --skip-publish --dry-run
npx nx release --projects=core,utilsAffected-only CI builds: Run nx affected:build --base=origin/main in pull request pipelines to build only projects touched by code changes, reducing CI time from hours to minutes for large repositories with dozens of applications.
Shared component library architecture: Create a @mycompany/ui library consumed by multiple apps, where Nx ensures changes trigger rebuilds only in dependent projects while caching unchanged library builds across team members and CI.
Automated package publishing: Use Nx Release to version and publish multiple npm packages with nx release, automatically generating changelogs from conventional commits and handling semver bumps across independent or fixed-version strategies.
Multi-framework workspace: Manage an Angular admin dashboard, React customer portal, and NestJS API in one repository, sharing TypeScript configurations and validation libraries while maintaining framework-specific build tools through Nx plugins.
Local development optimization: Speed up nx test and nx lint by leveraging local computation cache—Nx skips re-running tests when source files and dependencies haven't changed, even across git branch switches.
npm install nxpnpm add nxbun add nx