Useful Developer Tools
Beyond the linter, formatter, and hooks, a handful of small tools make day-to-day Node development noticeably smoother — running scripts across environments, keeping dependencies healthy and secure, inspecting bundle and install size, and managing Node versions. None is essential on its own, but together they remove friction and catch problems early. This page is a practical tour of the utilities worth knowing: cross-platform script helpers, dependency and security auditing, package analysis, Node version management, and the npm-script conventions that tie your workflow together.
Cross-platform scripts
npm install --save-dev cross-env rimraf # cross-env — set env vars the same way on Windows, macOS, and Linux: # "build": "cross-env NODE_ENV=production node build.js" # rimraf — 'rm -rf' that works everywhere (Windows has no rm -rf): # "clean": "rimraf dist"
Dependency health and security
npm outdated # list dependencies behind their latest version npm audit # report known security vulnerabilities in your deps npm audit fix # auto-update to patched versions where safe npx npm-check-updates -u # bump package.json to latest (review before installing!) npx depcheck # find unused dependencies (and missing ones)
Inspecting package size
Tool | Tells you | Why it matters |
|---|---|---|
| Exact files in your published package | Catch leaked secrets / bloat before publishing |
[bundlephobia.com] | A dependency's size & its transitive cost | Decide if a package is worth adding |
| Total installed size on disk | Spot runaway dependency growth |
| Why a package is installed (the dep chain) | Trace where a transitive dep comes from |
Managing Node versions
# nvm (or fnm / volta) lets you install and switch Node versions per project:
nvm install 20
nvm use 20
# Pin the project's version so everyone (and CI) uses the same one:
echo "20" > .nvmrc # nvm reads this; 'nvm use' picks it up
# package.json: "engines": { "node": ">=20" } → npm warns on mismatched versionsTie it together with npm scripts
package.json — a conventional script set
{
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
"start": "node dist/index.js",
"lint": "eslint .",
"format": "prettier --write .",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"clean": "rimraf dist",
"check": "npm run lint && npm run typecheck && npm run test" // one command for CI/local
}
}