Non-blocking in node js

I have doubt whether asynchronous and non-blocking is same or different.
JavaScript is a single thread language. It can only executive one thread at a time. JavaScript has heap memory and call stack. The asynchronous request in JavaScript achieved with help of call back function . The time when call back function execut , it will be put in call back que. Then event loop check whether the call stack is empty or not. If empty, event loop put this call back function into call stack and it will be executed. At the time when this call back function in call back que, it will do its operation with help of system thread. This is the understanding i have about asynchronous request. But then what is non blocking. In non blocking we use for IO operation with help of libuv. Here also we have call back which put in call back que. Then what is the difference between asynchronous and non-blocking

Non-blocking is any code that gives answer immediately, so the thread isn’t blocked, including both sync and async code.

Asynchronous is any code that outputs in non-linear fashion. Reasonably, it’s only possible if this code is non-blocking.

Analogy time: you’re standing in a queue to the nightclub. At the door bouncer asks for your ID, you’re starting looking all your pockets for ID. Now, 2 scenarios:

  1. ASYNC: Bouncer puts you aside while you’re looking and let other people in. When you finally find ID, he ‘punishes’ you and sends you at the end of the queue.
  2. SYNC: You’re looking for your ID - queue is blocked and you’re annoying everyone behind you. When you finally find ID, queue proceeds.

Demo time:

const asyncMsg = (msg, sec) => setTimeout(() => console.log(msg), sec * 1000);
const syncMsg = (msg, sec) => {
  const startTime =;
  while ( - startTime < sec * 1000) continue;

asyncMsg('ASYNC - LINE 1', 2);
console.log('ASYNC - LINE 2');

syncMsg('SYNC - LINE 1', 4);
console.log('SYNC - LINE 2');

// FIRST, run each demo separately, THEN run both at the same time

So meant to say that asynchronous request is non blocking and synchronise request is blocking
Am i right or not?

Generally yes, but it would be easier if you actually post some code. For example:
IF you make async request to a sync function operating on main thread that would still block the thread:

const stupidPromise = (time) => new Promise(res => {
  const startTime =;
  while ( - startTime < time * 1000) continue;

// Async function, because I'm cool dev, yo!
const t = async (time) => {
  const response = await stupidPromise(time);

console.log('Losers wait for stupid promises!');

This is especially applies to NodeJS. I see this kind of attempts to ‘promisify’ synchronous Node functionality quite a lot.