Question

node.js and npm 1. Input and output operations in Node.js are done in an asynchronous manner....

node.js and npm

1. Input and output operations in Node.js are done in an asynchronous manner. Explain what this means and also discuss why this is an advantageous design for a web server to use.

2. Outline the request methods and URL combinations for storing information about users of the system (e.g. POST /someURL, GET /someURL) that your server could use to allow a client to: create a new user on the system, access the list of users, and access a specific user on the server. For POST requests, outline what the data expectations of the request are.

3.Describe what you think the advantage(s) of using a package manager such as NPM for a project will be? (a project is planned to work on with several people over the next five years. )

Homework Answers

Answer #1

Ans-1) As stated Node.js is a Javascript runtime and it is asynchronous in nature. It means that the code executes without depending on the execution of the previous lines. When the Javascript engine runs the code, it converts it into the Promise type and then executes it asynchronously.Node.js operates on a single-thread, using non-blocking I/O calls, allowing it to support tens of thousands of concurrent connections held in the event loop.

The advantage is that the program doesn’t have to wait for the execution of the further code while the previous code is currently being executed. Hence, increasing the efficiency and throughput of the program. It also helps in faster execution of programs.

Ans-2 )

  • To create a new user on the system-POST /account
  • To access a specific user on the server-GET /account or GET /blogs can be used to get all blog entries for a particular user.
  • Example of a POST request:

var request = require('request');

request.post(
'http://www.mysite.com/page',
{ json: { key: 'value' } },
function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
}
);

Ans-3)As our project will be for next 5 years and multiple people will be involved then it will be advantageous using NPM as its job is to present an interface that assists the user in managing the collection of packages installed on their system.In our case all the people will work on their own module and in such big projects it may become hectic and inefficient and also result in redundancy.So to avoid this it will be beneficial to use NPM

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Template Engines: 1. a project requires to display a page containing some sort of user profile....
Template Engines: 1. a project requires to display a page containing some sort of user profile. With the system eventually having many possible users, how can a template engine help with this? 2. Outside of the user profiles, how could you apply a template engine to other parts? 3. AJAX allows a client to request some information and partially update a page using the data in the response. Template engines do not strictly have to generate an entire HTML page....
Who knows the true and false on all questions? 1. From a user’s viewpoint, coding is...
Who knows the true and false on all questions? 1. From a user’s viewpoint, coding is the most critical part of the system design T/F? 2. All screen designs should be documented for later use by programmers T/F? 3. A natural language feature requires users to type commands or requests in programming code using a set of instructions and symbols T/F? 4. Email is becoming an outdated means of internal and external business communication. T/F? 5. The database and the...
Case Study: Larson Property Management Company. Larson Property Management Company is one of the largest property...
Case Study: Larson Property Management Company. Larson Property Management Company is one of the largest property management companies in California, with more than 1,000 employees. The company provides a full array of commercial management and development services. These activities include complete management services for commercial office and retail buildings and apartment complexes; construction, repair, and maintenance of commercial properties; and financial management and billing services for commercial real estate clients. The company has experienced significant expansion over the past five...
CASE 3.2 Horizon Consulting Patti Smith looked up at the bright blue Carolina sky before she...
CASE 3.2 Horizon Consulting Patti Smith looked up at the bright blue Carolina sky before she entered the offices of Horizon Consulting. Today was Friday, which meant she needed to prepare for the weekly status report meeting. Horizon Consulting is a custom software development company that offers fully integrated mobile application services for iPhonetm, Androidtm, Windows Mobile® and BlackBerry® platforms. Horizon was founded by James Thrasher, a former marketing executive, who quickly saw the potential for digital marketing via smartphones....
1.Establishing the virtual Management: As known, managing virtual staff requires a different method or approach than...
1.Establishing the virtual Management: As known, managing virtual staff requires a different method or approach than managing local staff. Due to that reason, Golden Scent has developed a strategic plan to successfully manage its virtual staff in the USA. Identify the suitable manager. to make sure our work will proceed as we planned, Golden Scent willrecruit a virtual manager with the essential skills and knowledge required to manage virtual employees. Find the skilled people to work with. Since not everyone...
The Business Case for Agility “The battle is not always to the strongest, nor the race...
The Business Case for Agility “The battle is not always to the strongest, nor the race to the swiftest, but that’s the way to bet ’em!”  —C. Morgan Cofer In This Chapter This chapter discusses the business case for Agility, presenting six benefits for teams and the enterprise. It also describes a financial model that shows why incremental development works. Takeaways Agility is not just about the team. There are product-management, project-management, and technical issues beyond the team’s control. Lean-Agile provides...
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation....
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation. case:    W17400 APIGEE: PEOPLE MANAGEMENT PRACTICES AND THE CHALLENGE OF GROWTH Ranjeet Nambudiri, S. Ramnarayan, and Catherine Xavier wrote this case solely to provide material for class discussion. The authors do not intend to illustrate either effective or ineffective handling of a managerial situation. The authors may have disguised certain names and other identifying information to protect confidentiality. This publication may not be...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT