You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
</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> <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> </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> <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> </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> <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> </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> <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> </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> <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> </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> <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> </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 cComment">//handle the error</span>
<span class="token cBase">}</span>
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.