index.js
function(host, port) {
  var sock = new WebSocket('ws://' + host + ':' + port);
  sock.onopen = function() {
    console.log("Connected to browserify-reload handle");
  }

  sock.onmessage = function(msg){
    if(msg && msg.data == "reload")
      document.location = document.location.href;
  }
}
function(host, port) {
  var sock = new WebSocket('ws://' + host + ':' + port);
  sock.onopen = function() {
    console.log("Connected to browserify-reload handle");
  }

  sock.onmessage = function(msg){
    if(msg && msg.data == "reload")
      document.location = document.location.href;
  }
}
function ( host , port ) { var sock = new WebSocket ( 'ws://' + host + ':' + port ) ; sock . onopen = function ( ) { console . log ( "Connected to browserify-reload handle" ) ; } sock . onmessage = function ( msg ) { if ( msg && msg . data == "reload" ) document . location = document . location . href ; } }
this code is serialized and injected client-side as it might not be processed by browserify transform, keep it ES5
this code is serialized and injected client - side as it might not be processed by browserify transform keep it ES5