First of all I am new to nodejs and secondly below is my question. How to include nodejs net module in js which is loaded in html??
My js file looks like this.
To clarify what @T.J.Crowder said in the comment: What you are trying to do is impossible.
NodeJS is a server-side framework. The Javascript you write in NodeJS is executed on the server. The Javascript you write for your HTML pages is executed on the client. The client and server can not call each other's methods directly. This is what AJAX and other asynchronous client-server communication techniques are used for.