0Pricing
Frontend Academy · Lesson

npm and package.json: dependencies scripts

Initialise a project with npm init, add runtime and dev dependencies, write reusable npm scripts, and understand semver.

What Is npm?

npm (Node Package Manager) manages project dependencies and scripts. It reads package.json to know what to install, and writes package-lock.json to record exact versions. Over two million packages are published on the npm registry.

Initialising a Project

npm init -y creates a package.json with default values. The -y flag accepts all defaults without prompts.

mkdir my-project && cd my-project
npm init -y
# Creates package.json

All lessons in this course

  1. ES Modules: import export and dynamic import
  2. npm and package.json: dependencies scripts
  3. Vite: dev server and build
  4. Bundling Concepts: tree shaking code splitting
← Back to Frontend Academy