Rust Cargo to Node.js NPM Cheat Sheet
A quick reference for translating common Rust Cargo commands to Node.js NPM.
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.
Comments