Programming

17. Node.js Lessons. Timers, Differences from Browser, ref and ref

Hey, guys! Our today’s article will tell you about Node.js timers. Here we will try to tell you about all the differences existing between browser and Node.js timers. So, let us refer to our technical materials and see a number of similar methods:

Category: Programming
0

16. Node.js Lessons. Event Loop, libUV Library. Part 2

On that joyful note JavaScript execution ends, and libUV checks whether there is any watcher that can be activated, which means whether there is any internal handler. If there is no handler, the whole Node.js process gets finished, as well as the whole event loop, too. In our case, one watcher of this kind, in particular a port 3000 handler, was installed. That’s why a Node.js process is not going to finish, but will get a stand-by mode. It will stay in this mode until some reason to get activated occurs – for example, new input-output events.

Category: Programming
0

16. Node.js Lessons. Event Loop, libUV Library. Part 1

Hey, guys! If your habit is to learn something deeply and thoroughly, this article is for you. Here we will try to answer the questions that you will have sooner or later in the process of development. These answers require deep understanding of how Node.js works. For example, here (serverAsync.js see the files of our previous lesson) an asynchronous call is used for reading a file:

Category: Programming
0

15. Node.js Lessons. Async Development. Introduction.

In real life you will barely witness a situation, when once a request has been received, the server can immediately respond it. To do so, the server generally needs some data. These data can come from a database or another source – for example, a file system. In our example, when using the fs module upon receiving a request at url '/', the file index.html is being read and outputted to a visitor

Category: Programming
0

14. Node.js Lessons. Script Debugging pt 1.

Our next lesson is devoted to Node.JS debugging. First of all, we will explore the simplest built-in debugger that is called by the node debug command. It looks just like that. Imagine, we’ve got the script:

Category: Programming
0

13. Node.js Lessons. Development, Supervisor

Our goal for this lesson is to improve our Node.js development skills. The first thing that will help us in this task – and we’re going to learn it – is called supervisor. We’ve already created an echo server.

Category: Programming
0

12. Node.js Lessons. Documentation of Http Module.

We will further refer to the http module quite often, so let us now explore its supporting materials, what we can find there and where. Right now the http module combines two functional services. The first one is the server functionality. http.createServer creates a new object of a Server class. If a handler is transmitted, it will go to the request event. The second functional service is createClient.

Category: Programming
0

11. Node.js. Lessons. Echo-server.

Hey all! This lesson will be devoted to the echo server creation. This is a server that brings up the parameter meaning upon the url/echo request with the message parameter: // http://127.0.0.1:3000/echo?message=Hello -> Hello The answer to all other requests will be: Page Not Found. Let us start from a template of this kind:

Category: Programming
0

10. Node.js Lessons. Node.JS as a web server

Hey all! This time we will meet Node.js as a web server. So, let us create a new app for that purpose. Set up your editor in a way it would know you’re working on a Node.js project and support the respective auto-additions and global variables. Next let us create server.js and connect a module as the very first step:

Category: Programming
0

9. Node.js Lessons. Events, EventEmitter and Memory Leaks

The next object we are interested in is EventEmitter, or, as it is sometimes called, EE. EventEmitter is a basic object that executes work with events in Node.js. A great number of other built-in objects generating events inherit from it. To use EventEmitter you only need to connect the built-in “events” module and take a respective property from it (let us create ee.js);

Category: Programming
0

Sign in

Forgot password?

Or use a social network account

 

By Signing In \ Signing Up, you agree to our privacy policy

Password recovery

You can also try to

Or use a social network account

 

By Signing In \ Signing Up, you agree to our privacy policy