Introduction:

This article is a guide to creating a basic node/Express application with Create, Read, Update and Delete Capabilities. It is designed to not only be a helpful introduction for newcomers but also a handy reference guide with code snippets

<aside> <img src="/icons/drafts_green.svg" alt="/icons/drafts_green.svg" width="40px" /> Andrew Fisher

</aside>

Initialize + Organize Project + Install Dependencies

Initialize Project

Open a terminal window in your project directory and run the following command to begin installing a new node.js application. It will ask a series of prompts about the project and then set it up for you.

	npm init

Install Dependencies

We’ll use the following basic dependencies for our node.js CRUD functionality, run the following commands to install these packages.

Organize Project

index.js

The node.js application we are creating will primarily run out of a central file, which we will call index.js. The following command will create that file.

touch index.js

Static Files

As the application serves files to the client, it needs a central store of static files that our HTML can pull from. Let’s call that folder content and add folders for CSS, images and frontend JavaScript using these commands: