Index
General Project Initialization


Below is the step we will do before each project, using npm.

Initialize Project
  • Create a new project directory
  • Open console in project directory
  • Run npm "init" command as shown
  • Accept or enter defaults as desired
> npm init


NPM creates package.json in the project root directory.

Do We Always Need to Initialize a Project?


We could skip initialization if we will not be importing any code from the repository and we will not be publishing our project.

It is good practice to always initialize, especially as beginners, to commit the steps to muscle memory.

Running Node.js File


node
We start a node program in by simply using the "node" command followed by our "JS" filename (extension optional).

We can do this in the console, by script, or in an IDE.

Note - we should be in the project directory when we run it (same dir as JS file we are running).
>node hello-world
Hello World


Terms


TermMeaning
resabbreviation for "response"
reqabbreviation for "request"