Getting Started
We are going to use Homebrew to install NodeJS. When we install NodeJS, the Node Package Manager (npm) will be installed as well, so we can install node packages.
#
InstallOpen your terminal and run the following commands.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install node
If you do not already have a text editor, download and install Visual Studio Code. After you download VSCode launch the application and press CMD+Shift+P
. You should see a search box appear enter shell command
into the search box and select the option that says Shell Command: Install 'code' command in PATH
. Then relauch your terminal.
#
Create ProjectYou have the tools to create your project now you just need somewhere for it to go. Open your terminal and run the following commands.
mkdir projects
cd projects
Now that you have a folder for your projects; go to GitHub and create an account if you don't have one. After you have logged into your GitHub account click this link or click the plus button, to create a new repository for your project according to the specs below.
Property | Value |
---|---|
Template | No Template |
Name | Node Gif Search |
Description | Search for Gifs using NodeJS, ExpressJS, and Tenor. |
Privacy | Either option |
After you've created your repository on GitHub you should see a link like https://github.com/dylanplayer/Node-Gif-Search-Tutorial.git
under quick setup. Copy that link and run the following commands in your terminal. Make sure you are still in your projects directory
git clone "your link"
cd Node-Gif-Search
#
Initalize Node ProjectIn your terminal run the following commands, to initalize your project.
npm init -y
code .
Now that your code is open in VSCode press CTRL + ~
to open the terminal. Run the following command.
touch app.js
Open package.json
and set the main
file to app.js
. This will tell node that our code is in the app file.
{ ... "main": "app.js", ...}
#
Push To GitHubIn your terminal run the following commands, to push your current project to GitHub.
git add .
git commit -m "Init"
git push origin main