Skip to content

Tooling, Testing & Deployment

In the Node.js world you assemble your own toolchain: npm (or yarn/pnpm) for packages, tsc for compilation, eslint for linting, prettier for formatting, jest/vitest for testing, and esbuild/webpack/rollup for bundling. Each tool has its own config file, its own CLI flags, and its own ecosystem of plugins.

Rust ships with a single official tool — Cargo — that handles every one of those jobs:

Node / TS jobCargo equivalent
npm installcargo add / cargo fetch
tsccargo build
node index.jscargo run
eslintcargo clippy
prettiercargo fmt
jestcargo test
npm publishcargo publish
npx tsdoccargo doc

There is no “choose your own adventure.” The Rust community converges on a single formatter (rustfmt), a single linter (Clippy), and a single test runner. This means every Rust project looks familiar.

  • cargo.mdx — the Cargo.toml manifest, Cargo.lock, and the most important Cargo subcommands
  • clippy-rustfmt.mdx — linting with Clippy and formatting with rustfmt, mapped to eslint + prettier
  • testing.mdx — unit tests with #[test], integration tests, and doctests, mapped to Jest
  • workspaces-features.mdx — multi-crate workspaces and feature flags, mapped to npm workspaces
  • release-cross-compile.mdx — optimized release builds and cross-compilation to static binaries
  • docker-ci.mdx — multi-stage Dockerfiles and GitHub Actions for Rust projects
TypeScript
# Node / TypeScript
npm init -y
npm install typescript --save-dev
npx tsc --init
# Now you also need eslint, prettier, jest...
Rust
# Rust
cargo new my-app
cd my-app
cargo build # compiles
cargo run # compiles + runs
cargo test # runs all tests
cargo clippy # lints
cargo fmt # formats

This is a module overview lesson. Playground is not shown here — each subsequent lesson demonstrates a specific tool. Run the Cargo commands above in your terminal after installing Rust via rustup.rs.

Which Cargo subcommand is equivalent to running `npx jest`?
Which tool formats Rust code (the equivalent of Prettier)?
What is the main advantage of Rust's single official toolchain over the Node.js ecosystem?