emailjs/emailjs-tcp-socket

Support Electron

duanyao opened this issue · 3 comments

Electron, which is similar to NW.js, has node.js require() but not define(), so currently is not supported.

If change

    else if (typeof define === 'function' && define.amd && typeof nodeRequire !== 'undefined') {
        // amd under node-webkit
        define([], factory.bind(null, navigator, null, nodeRequire('net'), nodeRequire('tls')));
    }

to

    else if (typeof nodeRequire !== 'undefined') {
        factory(navigator, null, nodeRequire('net'), nodeRequire('tls'));
    }

it works in Electron.

It seems define() is not necessary even in NW.js?

the whole header was pretty stupid, i will put up a fix right away

Fixed with dac0697

published as v0.5.6