Node JS Road Map
Hello in this article wee will learn node js road map
The image below shows the technologies that a Node.js developer should know.
The technologies marked with a red flag are very important, and we must know them :)
The technologies marked with a yellow flag are also very useful for our work, and we should know them as well.
Knowing the technologies with a blue flag gives us an advantage.
For the ones with a white flag, it’s enough to know them as alternatives.
Just understanding what they do will suffice.
Yes, this is our roadmap :) Don’t be intimidated at first glance — we’ll go over each one step by step, explaining it in detail so we can learn thoroughly.
Yes, if you’re ready, let’s start with IDEs :)
1-) IDE’s
An IDE (Integrated Development Environment) is a software environment that helps developers with coding, editing, debugging, and running programs. IDEs make the software development process more efficient by offering tools like code editing, debugging, auto-completion, version control support, and project management all in one place.
-Visual Studio Code (VS Code): This open-source editor, developed by Microsoft, is very popular, especially because it can be extended with plugins. VS Code offers support for many languages, an integrated terminal, Git integration, and powerful debugging tools.
- IntelliJ IDEA / WebStorm: IntelliJ IDEA, developed by JetBrains, is a powerful IDE, especially for Java development, but it also supports other languages through plugins. WebStorm, also from the same company, is an IDE optimized for JavaScript, Node.js, and web development.
2-) JavaScripts
JavaScript is a programming language used to add interactive features to web pages. While HTML and CSS create the basic structure and appearance of a web page, JavaScript adds dynamic features to it. JavaScript can run on the browser, and it can also be used on the server-side with Node.js.
2.1-) Learn Syntax and Basic Operations
In JavaScript, basic syntax and operations include variable declaration, data types, operators, loops, and conditional statements.
2.2 -) DOM Manipulation
2.2.1 -) What is the DOM?
The DOM (Document Object Model) is a programming interface that represents HTML, XML, or XHTML documents. When a web browser loads a page, it creates a structure called the DOM. The DOM defines each element in the document (such as tags, texts, and attributes) as a “node” and shows the relationships between these nodes in a tree structure.
With the DOM, you can dynamically change the content, structure, and style of web pages using languages like JavaScript. With the DOM, you can:
- Access HTML and XML elements within the page.
- Navigate through the page and reach elements.
- Add new elements, modify existing ones, or delete them.
- Update page content based on user interactions.
- For example, changing a text or adding a new item to a list when clicking a button on a web page is done through the DOM.
With the DOM, you can use JavaScript to access, modify HTML and CSS elements, and add new elements.
2.3 -) IIFE (Immediately Invoked Function Expression)
IIFE (Immediately Invoked Function Expression) are functions that run as soon as they are defined. They are used to define variables within a limited scope.
2.4 -) Scope
Scope is the area where variables are accessible. In JavaScript, there are global and local scopes (including block scope and function scope).
2.5 -) Hoisting
In JavaScript, variables and functions can be used before they are defined, which is called hoisting. However, variables defined with let and const can only be used after the line where they are defined.
2.6 -) Clousures
In JavaScript, a closure is when a function can access variables defined outside its own scope. In other words, a function can access variables from the environment (lexical scope) where it was defined, and this access is preserved even after the scope where the function was defined ends.
2.6.1 -) How Does a Closure Work?
In JavaScript, when a function is defined, it is created not only with its own local variables but also by “remembering” the variables from the scope where it was defined. This happens with nested functions and variables defined in the outer scope.
2.6.2 -) Using Closures
- Data Privacy (Encapsulation): Closures allow functions to store private data or states that cannot be accessed directly from the outside.
- Function Factories: Closures are used to create customized versions of functions by accepting parameters.
- Callback Functions and Asynchronous Code: With closures, we can “remember” and carry certain states or values in asynchronous code.
In this example, the createCounter function creates a new sayac variable every time it is called, and this variable is stored inside the returned anonymous function. Since sayac1 and sayac2 each have their own sayac variable, they work independently of each other.
2.6.3 -) Advantages of Using Closures
- Data Security: By defining private variables that cannot be accessed from outside, closures provide data privacy.
- Memory Efficiency: A closure only keeps the data it needs and cleans up unnecessary variables.
- Flexibility and Modularity: You can create functions with custom settings for different tasks.
Closures are a powerful and commonly used feature in JavaScript, and they are very useful in advanced topics like functional programming and asynchronous operations.
2.7 -) Callbacks
In JavaScript, a callback is when another function is passed as a parameter to a function, and that function is called after a specific task is completed. Callbacks play an important role in JavaScript’s asynchronous nature, as they ensure the code runs in a specific order and under certain conditions.
2.7.1 -) Why Are Callbacks Used?
Since JavaScript is a single-threaded language, running operations synchronously can be inefficient, especially for long tasks (e.g., reading a file, fetching data, or timer operations). Callbacks allow us to define what should happen when these long tasks are completed, so other code blocks can continue running while waiting for the task to finish. This helps improve the user experience by preventing delays in the user interface.
2.7.2 -) What Do Callbacks Do?
- Asynchronous Programming: They delay actions until a task is completed and then execute them.
- Managing the Flow of Code: They make sure specific code runs when certain events or conditions happen
- Event-Driven Programming: They allow us to perform actions based on user interactions, timers, or data responses.
In this example, the getData function simulates data fetching and processes the data by calling the callback once the data arrives.
2.7.3 -) Advantages of Using Callbacks
- Flexibility: You can pass different callback functions to the same function to perform various tasks.
- Modularity: It makes your functions smaller and easier to manage.
- Better Code Organization: Defining actions to be performed when a task is complete makes the code cleaner and more understandable.
2.7.4 -) Disadvantage of Callbacks: Callback Hell ❗️
When callback functions are used too much and nested within each other, it can create a complex and hard-to-read structure known as “Callback Hell.”
To manage this structure, more advanced asynchronous patterns like Promises and async/await have started to be preferred. However, callbacks are an important JavaScript feature for understanding the basic concept.
2.8 -) Promises
In JavaScript, Promises are a structure that makes asynchronous operations more manageable and readable. A Promise represents the result of an operation that will be completed in the future, and it allows us to run different code blocks depending on whether it is successful or fails.
2.8.1 -) What Are Promises Used For and Why Are They Used?
Promises offer a strong solution for asynchronous operations. They are particularly used in the following situations:
- More Readable Code: They reduce the complexity of nested callback structures known as “callback hell,” allowing us to write more organized and readable code.
- Error Management: With Promises, it’s easier to catch errors because we can handle them in a separate block using the
.catch()block. - Chaining Operations: With Promises, we can chain operations and define them in sequence and independently.
2.8.2 -) Promise States
A Promise can be in one of three different states:
- Pending: The operation is not yet completed or has not failed.
- Fulfilled: The operation has been successfully completed and a result has been returned
- Rejected: The operation could not be completed due to an error.
2.8.3 -) Using Promises
A Promise is defined using the new Promise syntax. A Promise takes two parameters: resolve and reject. resolve indicates that the operation was successful and returns a value, while reject indicates that the operation failed due to an error.
A Promise is commonly used with asynchronous operations. For example, simulating data retrieval.
Get Sennfatih’s stories in your inbox
Join Medium for free to get updates from this writer.
In this example, resolve(data) and reject(error) are used. If the operation is successful, resolve(data) is called, while if it fails, reject("Data retrieval failed.") is invoked. This way, the catch block is triggered only when the operation fails, and it returns an error message.
Running Parallel Processes with Promise.all
You can use Promise.all() to run multiple Promises at the same time. If all operations are successful, the results are returned as an array; if one fails, it goes to the catch block.
2.9 -) Async & Await
In JavaScript, async and await are powerful tools that make asynchronous operations more organized and readable. Asynchronous operations are necessary for managing long-running tasks such as data fetching, timers, and file handling. async and await work with Promises to help us manage these operations more easily.
2.9.1 -) What Do Async & Await Do and Why Are They Used?
async and await, built on top of Promises, provide the following advantages:
- Readability: They allow writing cleaner and more readable code without the need for chaining structures like
.then()and.catch(). - Error Handling: They offer an easy way to handle errors with
try...catchblocks, making error catching simpler. - Writing Asynchronous Operations Like Synchronous Code:
awaitwaits for the operation to complete, so the code appears more understandable and looks like synchronous code.
2.9.2 -) How to Use Async & Await?
- async Keyword
When you define a function as async, it automatically returns a Promise. For example:
In this example, since the fetchData function is async, it returns a Promise and when the Promise resolves, it resolves with the value “Data received!”
awaitKeyword
await can only be used inside async functions and waits for a Promise to resolve. It waits for the operation to complete and does not proceed to other lines until the Promise is resolved. For example
- Let’s look at how to use async and await to retrieve and process data from an API:
await getData(...): await waits for the getData function to resolve, and when the result is successfully received, it is assigned to the data variable. If there's an error, it moves to the catch block.try...catch: Using try...catch is the most common method to catch errors in async functions that perform asynchronous operations with await
Async & Await with Promise.all for Parallel Work
You can use Promise.all file with a promise to execute multiple asynchronous operations simultaneously:
In this example, getData operations are started in parallel and await returns the result when all are completed. If there is an error, it is handled in the catch block.
Summary
async/awaitallows us to write asynchronous operations as if they were synchronous, resulting in cleaner and more understandable code.awaitwaits for a Promise to resolve, allowing operations to be performed either sequentially or in parallel.try...catchsimplifies error handling and provides a safer structure
async and await are among the most commonly used methods for handling asynchronous operations in modern JavaScript, and they are typically used with Promises.
Yes, in this section, we covered the IDEs that provide an environment for us to write code and the essential topics in JavaScript that we must know.
That’s enough for now, we will continue from where we left off in the next section.
See you in the next section :)










