Support Electron
duanyao opened this issue · 3 comments
duanyao commented
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?
felixhammerl commented
the whole header was pretty stupid, i will put up a fix right away
felixhammerl commented
Fixed with dac0697
felixhammerl commented
published as v0.5.6