Sparround

Node.js and npm basics

Node.js is the runtime that runs JavaScript outside the browser; all Playwright/Jest projects build on it.

package.json is the project's passport:

  • dependencies — needed at runtime
  • devDependencies — development/test only (Playwright goes here)
  • scripts — shortcuts: npm run test:smoke

package-lock.json — the exact version tree; always committed to git (for reproducible installs).

npx playwright test runs the package from local node_modules (no global install needed).

CommandWhat it does
npm installinstalls dependencies, may update the lock file
npm ciexact install from the lock file; the CI standard
npm run <script>runs a command from package.json scripts
npx <package>runs a package locally/temporarily
npm outdated / auditoutdated packages / security vulnerabilities

📚 Sources and documentation