Use npm init To Create New Node Projects
September 2021
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 initYou'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
From there, use npm i to install modules. For example, install puppeteer with:
npm i puppeteerProbably a good idea to do an
git initAnd then push in the .gitignore and all that jazz.
end of line