Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's node.js description fix #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
95
Node.js interview questions here 👉
https://devinterview.io/dev/nodejs-interview-questions
</p> <br data-v-5e9078c0=""> <br data-v-5e9078c0=""> <div data-v-5e9078c0="" class="unit"><div><h2>🔹 1. What is npm?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p><code>npm</code> stands for Node Package Manager. npm provides following two main functionalities:</p><ul><li>Online repositories for node.js packages/modules which are searchable on <a href="http://search.nodejs.org">search.nodejs.org</a></li><li>Command line utility to install packages, do version management and dependency management of Node.js packages.</li></ul></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="http://www.tutorialspoint.com/nodejs/nodejs_interview_questions.htm" rel="noreferrer" target="_blank" title="What is npm? Interview Questions Source To Answer">tutorialspoint.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 2. What is Node.js?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>Node.js is a web application framework built on Google Chrome's JavaScript Engine (V8 Engine).</p><p>Node.js comes with runtime environment on which a Javascript based script can be interpreted and executed (It is analogus to JVM to JAVA byte code). This runtime allows to execute a JavaScript code on any machine outside a browser. Because of this runtime of Node.js, JavaScript is now can be executed on server as well.</p><p><em>Node.js = Runtime Environment + JavaScript Library</em></p></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="http://www.tutorialspoint.com/nodejs/nodejs_interview_questions.htm" rel="noreferrer" target="_blank" title="What is Node.js? Interview Questions Source To Answer">tutorialspoint.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 3. What are the two types of API functions in Node.js?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>The two types of API functions in Node.js are: a) Asynchronous, non-blocking functions b) Synchronous, blocking functions</p></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="http://www.lazyquestion.com/interview-questions-and-answer/nodejs" rel="noreferrer" target="_blank" title="What are the two types of API functions in Node.js? Interview Questions Source To Answer">lazyquestion.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 4. What is an error-first callback?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p><em>Error-first callbacks</em> are used to pass errors and data. The first argument is always an error object that the programmer has to check if something went wrong. Additional arguments are used to pass data.</p><pre><code>fs<span class="token cBase">.</span><span class="token cMod">readFile</span><span class="token cBase">(</span>filePath<span class="token cBase">,</span> <span class="token cVar">function</span><span class="token cBase">(</span><span class="token parameter">err<span class="token cBase">,</span> data</span><span class="token cBase">)</span> <span class="token cBase">{</span>
</p> <br data-v-5e9078c0=""> <br data-v-5e9078c0=""> <div data-v-5e9078c0="" class="unit"><div><h2>🔹 1. What is npm?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p><code>npm</code> stands for Node Package Manager. npm provides following two main functionalities:</p><ul><li>Online repositories for node.js packages/modules which are searchable on <a href="http://search.nodejs.org">search.nodejs.org</a></li><li>Command line utility to install packages, do version management and dependency management of Node.js packages.</li></ul></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="http://www.tutorialspoint.com/nodejs/nodejs_interview_questions.htm" rel="noreferrer" target="_blank" title="What is npm? Interview Questions Source To Answer">tutorialspoint.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 2. What is Node.js?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>Node.js is an asynchronous event-driven JavaScript runtime, that allows you to run your JavaScript code outside web browser.</p><p>Node.js uses <b>V8 engine</b> to parse and execute JavaScript code under the hood. V8 is written in C++ which makes Node.js very fast.</p><p>It's a platform independed runtime. You can install it on Windows, Linux or MacOS.</p><em><p>Node.js is neither a framework nor a library</p></em></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="https://nodejs.org/en/about" rel="noreferrer" target="_blank" title="What is Node.js? Interview Questions Source To Answer">nodejs.org</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 3. What are the two types of API functions in Node.js?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p>The two types of API functions in Node.js are: a) Asynchronous, non-blocking functions b) Synchronous, blocking functions</p></div></div><div class="row my-2"><div><span><i>Source:</i>&nbsp;<span><a href="http://www.lazyquestion.com/interview-questions-and-answer/nodejs" rel="noreferrer" target="_blank" title="What are the two types of API functions in Node.js? Interview Questions Source To Answer">lazyquestion.com</a></span></span>&nbsp; &nbsp;</div></div></div></div></div> <br><br></div><div data-v-5e9078c0="" class="unit"><div><h2>🔹 4. What is an error-first callback?</h2></div> <div><h3>Answer:</h3> <div class="answer"><div><div><div class="AnswerBody"><p><em>Error-first callbacks</em> are used to pass errors and data. The first argument is always an error object that the programmer has to check if something went wrong. Additional arguments are used to pass data.</p><pre><code>fs<span class="token cBase">.</span><span class="token cMod">readFile</span><span class="token cBase">(</span>filePath<span class="token cBase">,</span> <span class="token cVar">function</span><span class="token cBase">(</span><span class="token parameter">err<span class="token cBase">,</span> data</span><span class="token cBase">)</span> <span class="token cBase">{</span>
<span class="token cVar">if</span> <span class="token cBase">(</span>err<span class="token cBase">)</span> <span class="token cBase">{</span>
<span class="token cComment">//handle the error</span>
<span class="token cBase">}</span>
Expand Down