Question

In: Computer Science

Question 1: What third-party modules does this project use? What are they? What are their versions?...

Question 1: What third-party modules does this project use? What are they? What are their versions? How did you find that information?

Question 2: Who are the contributors for socket.io module? List their names and email addresses.

Question 3: What do you need to do if the event name ‘chat message’ is changed to ‘trump’ in index.html file so that the application doesn’t break?

var socket = io();

$('form').submit(function(){

socket.emit('trump', $('#m').val());

$('#m').val('');

return false;

});

socket.on('trump', function(msg){

$('#messages').append($('<li>').text(msg));

});

index.js:

var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);

app.get('/', function(req, res){
  res.sendFile(__dirname + '/index.html');
});

io.on('connection', function(socket){
  socket.on('chat message', function(msg){
    io.emit('chat message', msg);
  });
});

http.listen(3000, function(){
  console.log('listening on *:3000');
});

Solutions

Expert Solution

Ans 1) The app uses the following third party modules-

(i) socket.io - It is a library which enables the flow of communication between a server and browser. Browser can send, receive the information to and from the server. For instance the chat applications in node.js uses the socket.io module.

The version can be found from the package.json file in the project that will be like socket.io-3.0 or if there is no package.json file present you can directly open the official website of library and fing out the latest version.

It is being imported in your index.js file at line number 3.

(ii) express - It is a framework used for the the for building robust application in node.js. It provides a wide range of functionalities and API's to ease your application building process. For e.g you have used http which is API given by express.

The version can be found from the package.json file in the project that will be like express-2.3 or if there is no package.json file present you can directly open the official website of library and fing out the latest version.

It is being imported in your index.js file at line number 1.

Ans 2) Socket.io is built by Auttomattic Inc. The main author of socket.io is Guillermo Rauch.

Names of the community behind Socet.io. ( However their email addresses are not public,so i am giving you their linked in profiles)

Guillermo Rauch (Linked in- https://www.linkedin.com/in/guillermo-rauch-b834b917b/)

Arnout Kazemier (Linked in - https://www.linkedin.com/in/arnoutkazemier/?originalSubdomain=nl)

Jay Borenstein (Linked in - https://www.linkedin.com/in/jayborenstein/)

Ans 3) If you change the event name from chat message to trump in your html file then you can also edit your index.js file by replacing the socket.on('chat message' with socket.on('trump'.


Related Solutions

Third-party lenders sometimes provide gap financing for project developments. Why is this lending used? How does...
Third-party lenders sometimes provide gap financing for project developments. Why is this lending used? How does it work?
True or False questions 1. Monetary risk can be minimized through the use of third-party providers,...
True or False questions 1. Monetary risk can be minimized through the use of third-party providers, such as freight forwarders. True or False ? 2. The "maturity period" is the third stage in the product life cycle. True or False ? 3. Global sourcing of materials poses a much higher risk for loss of intellectual property compared to global outsourcing of manufacturing. True or False ? 4. The geographic location of a Plant can be a cost driver when it...
What party is responsible for developing the project plan? What does the Controlling Process Group in...
What party is responsible for developing the project plan? What does the Controlling Process Group in the project management life cycle represent. Paragraph Monthly (Progress Schedule Submission) falls under what process of the project management life cycle? Why? In your words, explain WBS (Work Breakdown Structure) Why is the WBS an important component in planning the CPM Schedule?
What are some of the third party services offered in the transportation industry?
What are some of the third party services offered in the transportation industry?
What would it take for a third party to succeed in the United States, and why?...
What would it take for a third party to succeed in the United States, and why? Make an argument as to why you think this could be possible - or NOT.
What would it take for a third party to succeed in the United States, and why?...
What would it take for a third party to succeed in the United States, and why? Make an argument as to why you think this could be possible - or NOT.
10.29 What are the common advantages & disadvantages of accepting third party credit cards as a...
10.29 What are the common advantages & disadvantages of accepting third party credit cards as a means of offering sales on credit?
Healthcare Financing reference cite needed Discuss the differences between second-party payment and third-party payment. What led...
Healthcare Financing reference cite needed Discuss the differences between second-party payment and third-party payment. What led to the creation of the third-party payment system?
Third party conflict resolution: The Seatcor Manufacturing Company In regards to the scenario below, what is...
Third party conflict resolution: The Seatcor Manufacturing Company In regards to the scenario below, what is the best strategy to use? Thanks! ********************* Third-Party Conflict Resolution Introduction In addition to being involved in their own conflicts, managers are often called upon to intervene and to settle conflicts between other people. The two activities in this section are designed to explore how third parties may enter conflicts for the purpose of resolving them, and to practice one very effective approach to...
What is benchmarking? Discuss some of factors to be considered when using a third-party authority to...
What is benchmarking? Discuss some of factors to be considered when using a third-party authority to conduct the benchmarking review.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT