Engrain by ByteRush

FND.05.02 BeginnerCore — asked often

npm, package.json and dependencies

Comes up in: Recruiter screen

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • package.json fields
  • npm init, install, run
  • dependencies vs devDependencies
  • node_modules
  • lockfiles and why to commit them
  • semver (^, ~)
  • npx
  • alternatives (pnpm, yarn) briefly

Words you will know

packagedependencylockfilesemantic versioningscript

What you will practise

  • add a dependency and a script
  • read a semver range quiz

Interview questions this answers

  • What is the difference between dependencies and devDependencies?
  • Why do we commit the lockfile?
  • What does ^1.4.2 mean in package.json?