title: Node.js code inside Javascript of Asp.Net
body: <p>Very New to Node.js...</p>
  
  <p>I am working on reading a barcode from a COM Port of a R232 Barcode Scanner.<br>
  I have found a Node.js call serialport and installed it.  I can successfully read the barcode scan, from within a node.js command window, using the example from the installation.</p>
  
  <p>My next step is to see if I can integrate this barcode scan within my ASP.net Web Forms application.  I am hosting my application in IIS not looking to change that.  Also trying to avoid using ActieX or Java Applets or Silverlight.  Also trying to keep it browser based vs native Windows Desktop Application.  At the moment don't have the time to convert to Asp.Net MVC.</p>
  
  <p>This is now where I am confused.  </p>
  
  <p>1) Node.js can create its own web server and serve its own html content without the need of IIS.  So that leads me to believe these two technologies cannot co-exist within the same project/web server instance.  Is this true?</p>
  
  <p>2) What I want to do is in the javascript of my Web Forms Application, make the call to read the serial port and populate an input textbox with the results.  I don't want to start piecing this together if this is not possible, and I don't think it is.  Looking for verification on my hypothesis.   </p>
  
  <p>e.g.</p>
  
  <pre><code>&lt;!-- HTML FORM --&gt;    
  &lt;input type="textbox" id="txtBarcode" /&gt;
  
  
  &lt;!-- Javascript Section --&gt;
  &lt;!-- Bind some event for the input textbox --&gt;
  &lt;script&gt;
  
     function ReadScan(){
     var com = require("serialport");
  
     var serialPort = new com.SerialPort("COM4", {
         baudrate: 9600,
         parser: com.parsers.readline('\r\n')
       });
  
     serialPort.on('open',function() {
       console.log('Port open');
     });
  
     serialPort.on('data', function(data) {
        //I don't think will work here....
       $('#txtBarcode').val(data);
     });
  }
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>3) I think what I am trying to do is treat node.js as just another web Javascript library like knockout.js or jQuery.  Can I treat Node.js this way or no?</p>