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)