Zero to Node Js mastery
1. How do you run JavaScript ?
sol: we need a run time environment to run JavaScript code.
If we want to run JavaScript code outside of the browser then we need to install nodeJs run time environment.
Note: NodeJs is not a Programming language or not a framework.
It is a runtime environment.
NodeJs is a JavaScript runtime built on Chrome's V8 JavaScript engine.
libuv: libuv is a multi-platform C library that provides support for asynchronous I/O
based on event loops.
It is primarily designed for use in NodeJs.
REPL: Read Evaluate Print Loop.
REPL use in terminal for instant work.
2. is JavaScript Synchronous or Asynchronous?
sol: out of the box JavaScript is Synchronous.
3. Node Js Modules:
ans:
core module or built in modules:
http module
fs module
events module
path module
Why we use Modules:
i. Reuse existing code
ii. Organize your code
iii. Expose only what will be used.
4. Node Package Manager NPM:
different between Module and Package:
Module: Module is a file that contain some code which may be exported from module.
Package: A package is kind of like a collection of Modules.
5. NPM audit :
Do this regularly to safe program from attacker.
find the vulnerability run: npm audit
fix the vulnerability run : npm audit fix
CORS: Cross Origin Resource Sharing.
6. RESTFUL API:
Restful API are those that follows a certain style or pattern that we use when building http
API.
REST: Representational State Transfer.