Node.js
Node.js is a javascript environment that allows us to use javascript on the server side.
Before Node.js, Javascript could only be used on the frontend and would have to be used with a backend language such as php or ruby.
With node.js, this ability to use javascript on the server side means we can create a full stack applications using one language.
To develop an app we need Javascript to be understood by all the ‘parts that make the browser’.
Create, read, update, delete actions written in javascript are interpreted by node to be used with Mongodb
Above are back-end process which include getting files from our server, updating files, creating files.
By default, our server processes do not have a inbuilt interpreter for javascript, so this functionality needs this to be added to allow you to run Javascript in the back-end.
Node.js, an interpreter, environment of libraries and a free open-source server network, can help with the above, essentially running generally purpose Javascript.
Node.js eliminates the waiting between file requests, and simply continues with the next request.
Essentially, node.js runs single-threaded, non-blocking, asynchronously programming, which is very memory efficient.
Node.js has the ability to generate dynamic page content; it can also create, open, read, write, delete, and close files on the server; node can also collect form data, as well as being able to add, delete, modify data in your database. Node.js files always have extensions ".js"
Node itself includes the node package manager or npm for short, which are essentially a collection of modules, which are essentially pre-defined libraries.
One of the modules available with node are http, which allows the user to transfer HTTP data. The module http is able to create a http server port and respond back to the client. The http node module includes the createServer() method which creates the server.
Node also has a nodemailer module that makes it easy to send emails from your computer.There is also a module to manipulate files and monitor events. A good way of thinking about node’s modules is that they are similar to ruby gems and the associated methods.
It is possible to use these modules to use in your code. The user must first install the module using npm.
Node.js can also be thought of as an asynchronous, event-driven engine. The user’s application makes a request to the server and then continues working on other useful tasks rather than stalling while it waits for a response. On completion of the requested task, the application is informed of the results via a callback.
This enables large numbers of operations to be performed in parallel which is essential when scaling applications.
Node is responsible for data interaction between front, back and database, enabling server-side scripting, generating dynamic web pages before data is sent to the client, it has good scalability, supports non-blocking calls, concurrency and callback support.