Edit in JSFiddle

$(function() {
  $('.highlight').codemirror({
    mode: 'javascript',
    runmode: true
  });
  var editor1 = $('.editor').codemirror({
    mode: 'javascript',
    lineNumbers: true
  });
});
<h3>syntax highlight editor</h3>
<textarea class="editor" id="code">var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');</textarea>

<h3>highlight only (runmode)</h3>
<textarea class="highlight">var net = require('net');
 
var server = net.createServer(function (socket) {
  socket.write("Echo server\r\n");
  socket.pipe(socket);
});
 
server.listen(1337, "127.0.0.1");</textarea>

              
            
          
            
              

External resources loaded into this fiddle: