Rust Cargo to Node.js NPM Cheat Sheet

February 28, 2025

A quick reference for translating common Rust Cargo commands to Node.js NPM commands.

Cargo Command

NPM Command

cargo new project_name

npm init

cargo build

npm install

cargo add package

npm install package

cargo remove package

npm uninstall package

cargo install package (for binaries only)

npm install -g package

cargo update

npm update

cargo run

npm run start

cargo build --release

npm run build

cargo test

npm test

cargo publish

npm publish

cargo tree (requires cargo-tree)

npm list

cargo outdated (requires cargo-outdated)

npm outdated

cargo audit (requires cargo-audit)

npm audit

cargo clean && cargo build

npm ci

cargo run --bin package (or install manually)

npx package

cargo path

npm link

Use this cheat sheet as a guide when working between Rust Cargo and Node.js NPM.

Anthony Tietjen

About the Author

Anthony Tietjen is a software engineer with experience across desktop, mobile, and web development. Husband and father, with a passion for music and the outdoors. Connect with Anthony on LinkedIn and X/Twitter

About StratusCube

StratusCube makes software for everyday use along with software engineering articles. If you enjoined this article, please take a moment to browse our apps or check out more articles .