Is Node js hard to learn ?
Summary
Node.js is a runtime environment that enables JavaScript execution outside of web browsers. While it's not a mandatory technology stack, it is widely adopted in development. This article covers Node.js fundamentals, providing you with a quick overview. From that, you'll be able to answer the question: Is Node Js hard to learn.
What is NodeJs ?
NodeJs vs Browser
How to execute Js by NodeJs ?
Global variables in NodeJs
Why we need modules in Node application ?
Real project is complex, so we need to break down huge logic into modules to manage easily
How do you identify if a Node.js project uses CommonJS or ES modules?
There are some common ways to check:
Check type in package.json
// package.json
{
"type": "module"
}
//"type": "module" → ES Modules (ESM)
//"type": "commonjs" OR no "type" → CommonJS (default)Check File Extensions
Extension Module System
.mjs => ES Modules
.cjs => CommonJS
.js => Depends on package.json "type"Check syntax
//CommonJS (CJS)
const fs = require('fs');
module.exports = function() {};
//ES Modules (ESM)
import fs from 'fs';
export default function() {};Export in NodeJs
Built-in Modules
OS module
Path module
Fs Module
Create web server in NodeJs
Define basic routes ( More detail in Express section )
NPM - Node Package Manager
Why do we need the package.json file ?
It's required to install packages to project, package.json file will store information of installed packages as a dependency
When sharing code, ignore node_modules file to reduce size of repo
What are "devDependencies" packages ?
npm commands
npm remove package
Global package
Install nodemon package global
What is package-lock.json ?
Handle long-running tasks: Browser vs NodeJs
NodeJs Event Loop Examples
Example when synchronous logic will block multiple request
How to handle asynchronous in NodeJs ?
Example of using Async/Await
















































