How to use engine - 10 common examples

To help you get started, we’ve selected a few engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bigcompany / resources / mesh / index.js View on Github external
function attach() {
    //
    // Remark: mesh.server is the same as http.server
    //
    mesh.server = engine.attach(resource.http.server);
    mesh.server.on('connection', function(socket){
      mesh.downlink(socket, function(err, result){
        if (err) {
          throw err;
        }
      });
    });
    callback(null, mesh.server);
  }
};
github physiii / open-automation / node_modules / engine.io / lib / transports / websocket.js View on Github external
packets.forEach(function(packet) {
    parser.encodePacket(packet, self.supportsBinary, function(data) {
      debug('writing "%s"', data);
      self.writable = false;
      self.socket.send(data, packet.options, function (err){
        if (err) return self.onError('write error', err.stack);
        self.writable = true;
        self.emit('drain');
      });
    });
  });
};
github iamdjones / sublime-text-browser-sync / node_modules / browser-sync / node_modules / engine.io / lib / transports / websocket.js View on Github external
WebSocket.prototype.send = function (packets) {
  var self = this;
  for (var i = 0, l = packets.length; i < l; i++) {
    parser.encodePacket(packets[i], this.supportsBinary, function(data) {
      debug('writing "%s"', data);
      self.writable = false;
      self.socket.send(data, function (err){
        if (err) return self.onError('write error', err.stack);
        self.writable = true;
        self.emit('drain');
      });
    });
  }
};
github socketstream / socketstream / node_modules / engine.io / lib / transports / websocket.js View on Github external
WebSocket.prototype.send = function (packets) {
  var self = this;
  for (var i = 0, l = packets.length; i < l; i++) {
    parser.encodePacket(packets[i], this.supportsBinary, function(data) {
      debug('writing "%s"', data);
      self.writable = false;
      self.socket.send(data, function (err){
        if (err) return self.onError('write error', err.stack);
        self.writable = true;
        self.emit('drain');
      });
    });
  }
};
github booknds / sge / node_modules / browser-sync / node_modules / socket.io / node_modules / engine.io / lib / transports / websocket.js View on Github external
WebSocket.prototype.send = function (packets) {
  var self = this;
  for (var i = 0, l = packets.length; i < l; i++) {
    parser.encodePacket(packets[i], this.supportsBinary, function(data) {
      debug('writing "%s"', data);
      self.writable = false;
      self.socket.send(data, function (err){
        if (err) return self.onError('write error', err.stack);
        self.writable = true;
        self.emit('drain');
      });
    });
  }
};
github Ezelia / eureca.io / lib / js / primus.js View on Github external
Polling.prototype.write = function(packets){
  var self = this;
  this.writable = false;
  var callbackfn = function() {
    self.writable = true;
    self.emit('drain');
  };

  var self = this;
  parser.encodePayload(packets, this.supportsBinary, function(data) {
    self.doWrite(data, callbackfn);
  });
};
github iamdjones / sublime-text-browser-sync / node_modules / browser-sync / node_modules / engine.io-client / lib / transports / polling.js View on Github external
Polling.prototype.write = function(packets){
  var self = this;
  this.writable = false;
  var callbackfn = function() {
    self.writable = true;
    self.emit('drain');
  };

  var self = this;
  parser.encodePayload(packets, this.supportsBinary, function(data) {
    self.doWrite(data, callbackfn);
  });
};
github KMKNKK / Chatroom-WebSocket / jQuery-chat / node_modules / engine.io-client / lib / transport.js View on Github external
Transport.prototype.onData = function (data) {
  var packet = parser.decodePacket(data, this.socket.binaryType);
  this.onPacket(packet);
};
github socketio / engine.io-client / lib / transport.js View on Github external
Transport.prototype.onData = function (data) {
  var packet = parser.decodePacket(data, this.socket.binaryType);
  this.onPacket(packet);
};
github ericmandel / js9 / node_modules / socket.io / node_modules / socket.io-client / node_modules / engine.io-client / lib / transport.js View on Github external
Transport.prototype.onData = function(data){
  var packet = parser.decodePacket(data, this.socket.binaryType);
  this.onPacket(packet);
};

engine

Template engine based on Lo-Dash template, but adds features like the ability to register helpers and more easily set data to be used as context in templates.

MIT
Latest version published 6 years ago

Package Health Score

51 / 100
Full package analysis