home ~ projects ~ socials

Use npm init To Create New Node Projects

Adding a package.json file to a directory turns it into a node project. You can do this manually, or use `npm init`. For example:

mkdir new_project_name
  cd new_project_name
  npm init

You'll be asked a series of questions to configure the setup. I usually just hit enter for all of them. The process produces a package.json file based on your answers.

To get something that runs, make an index.js file with something like:

#!/usr/bin/env node

  console.log('here')

From there, use npm i to install modules. For example, install puppeteer with:

npm i puppeteer

Probably a good idea to do an

git init

And then push in the .gitignore and all that jazz.

-- end of line --