calvinfo / socket-ntp

NTP Sync using Socket.io
42 stars 6 forks source link

Browserify support #7

Open gre opened 9 years ago

gre commented 9 years ago

Hi, socket-ntp is currently not browserify compliant. Here is how we can make it compliant:

in package.json, add:

"browser": "client/ntp"

in client/ntp.js:

  if (typeof require === 'function') {
    module.exports = ntp;
  }
  else if (typeof define === 'function' && define.amd) {
    define('ntp', [], function () {
      return ntp;
    });
  } else {
    root.ntp = ntp;
  }

Thanks

bwestergard commented 8 years ago

I'd like this.

calvinfo commented 8 years ago

Totally, happy to accept a PR for it! This code hasn't been maintained recently