DEV Community

Backend development & Nodejs

I start the back-end development understanding that a back-end web developer is responsible for server-side web application logic and integration of the work front-end developers do. Back-end developers are usually writing the web services and APIs used by front-end developers and mobile application developers. I was introduced to Node js as

🔹ī¸ Node.js is an open-source server environment
🔹ī¸ Node.js is free
🔹ī¸ Node.js runs on various platforms (Windows, Linux, Unix, Mac OS, etc.)
🔹ī¸ Node.js uses JavaScript on the server

What Node.js Do?

🔹ī¸ Node.js can generate the dynamic page content
🔹ī¸ Node.js can create, open, read, write, delete, and close files on the server
🔹ī¸ Node.js can collect form data
🔹ī¸ Node.js can add, delete, modify data in your database

What a Node.js File is?

🔹ī¸ Node.js files contain tasks that will be executed on certain events
🔹ī¸ A typical event is someone trying to access a port on the server
🔹ī¸ Node.js files must be initiated on the server before having any effect
🔹ī¸ Node.js files have extension ".js"

What is a Module in Node.js?

🔹ī¸ Modules are considered to be the same as JavaScript libraries. A set of functions you want to include in your application.

Node.js as a File Server

🔹ī¸ The Node.js file system module allows you to work with the file system on your computer.

To include the File System module, use the require() method:

    var fs = require('fs');
Enter fullscreen mode Exit fullscreen mode

A common use for the File System module:

🔹ī¸ Read files
🔹ī¸ Create files
🔹ī¸ Update files
🔹ī¸ Delete files
🔹ī¸ Rename files

The Built-in URL Module

The URL module splits up a web address into...
readable parts. To include the URL module, use the require() method:

     var url = require('url');
Enter fullscreen mode Exit fullscreen mode

What is NPM?

🔸 NPM is a package manager for Node.js packages, or modules if you like. I proceed By installing an NPM library and running it in my hyper terminal which I console log a random superheroes name and supervillain name.

Top comments (0)