browserifiable version
Closed this issue · 3 comments
fanatid commented
https://github.com/ethereumjs/keythereum/blob/0.4.7/index.js#L8-L11
- why
NODE_JS
defined as(typeof module !== "undefined") && process && !process.browser
? not justprocess.browser
? - instead
var path = (NODE_JS) ? require("path") : null;
will better resolve throughbrowser
field inpackage.json
tinybike commented
Read a bit about this today and it seems there is not a consensus on the best way to detect Node.js vs browser environment. Apparently browserify and webpack are the edge cases that create complications. I thought this discussion was good -- conclusion was that the "right" way to do this is:
typeof process !== "undefined" && process.nextTick && !process.browser
tinybike commented
Well, process.nextTick
is defined if you require('process')
, but the browser does not normally have process.nextTick
(or process
) defined.