We are your Digital Ally™
Tech talks: NPM dependencies
education

Tech talks: NPM dependencies

A summary of an Instea tech talk on npm version 2, covering dependency management, semantic versioning, devDependencies, and best practices for JavaScript projects.

Stanislav MiklikNovember 10, 2015

This technical presentation focuses on npm version 2 with emphasis on managing project dependencies. The guide covers both server-side and client-side JavaScript dependency handling for tools like React and Webpack.

Basics

  • Initialize projects using npm init to create package.json
  • Install dependencies with npm install <package-name> --save
  • The --save flag updates package.json automatically
  • npm handles transitive dependencies automatically

Collaboration

  • Team members install dependencies via npm install
  • Unused dependencies flagged with npm ls
  • Remove extraneous packages using npm prune

Version Management

  • Check outdated packages with npm outdated
  • Update dependencies using npm update --save
  • npm follows semantic versioning conventions
  • Caret syntax ^2.10.6 allows non-breaking updates

Dependency Types

  • devDependencies: Testing and development tools (installed with --save-dev)
  • Global dependencies: System-wide utilities (not recommended for project management)
  • Scripts: Execute local tools via package.json scripts section

Code Examples

npm install async --save
npm outdated
npm update --save
npm run lint -- --format compact

Recommendation

Maintain all project dependencies locally in package.json rather than installing globally to ensure consistency across different projects.

© 2026