Skip to content
Parwaz DigitalMarketing · Web · Courses

Web Development Course · Module 4, lesson 5

Everyday professional workflow: npm, tools and habits

Learn the everyday tools and habits of a real codebase: Node.js and npm packages, scripts, formatters and linters, environment variables and documentation.

What you will learn

  • Install packages and run scripts with npm and package.json
  • Use a formatter and linter in VS Code to keep code consistent
  • Keep secrets in environment variables and document how to run a project

Most modern web projects use Node.js and its package manager, npm. A package.json file lists the project's dependencies and its scripts. npm install downloads every dependency into node_modules, and the package-lock.json file records exact versions so everyone gets the same setup. Scripts are shortcuts for common tasks, so npm run dev might start a local development server and npm run build might produce the final site.

Formatters and linters keep code tidy. Prettier is a widely used formatter that rewrites code to a consistent style, which ends arguments over spacing and quotes. ESLint is a linter that warns about likely mistakes, such as unused variables. Both integrate with VS Code, and many developers set the editor to format a file every time it is saved.

Keep passwords and API keys out of your code. Store them in environment variables, often in a .env file that is listed in .gitignore, and read them in your code at runtime. Write down what the project needs in the README, such as how to install it and which variables to set. Clear setup steps make it easy to return to a project months later.

Practice task

Install Node.js, run npm init -y in a new folder, install Prettier as a development dependency, add a format script to package.json and run it on your bakery files.

Web Development Course

Learn this properly,with a final project.

These pages summarise each lesson. The full course teaches them hands-on. Message us for the current fee, schedule, and format.

Available for new projects — Replies within one business day