defunctzombie / node-process

process information for node.js and browsers
MIT License
122 stars 62 forks source link

Missing `process.version` #30

Closed anandthakker closed 9 years ago

anandthakker commented 9 years ago

A module that's using process.version.match(...) fails in the browser because there's no process.version on the shim. See https://github.com/substack/node-browserify/issues/690.

defunctzombie commented 9 years ago

What would make sense for the version field? The user agent? Blank string? Maybe the module doing version match should be smarter?

anandthakker commented 9 years ago

Hmm. I'd probably favor a blank string, so as to avoid sloppy regex checks from accidentally matching anything. Certainly agree that it would be nice for the module to be smarter, but it seems like plenty of people could be assuming that process.version is defined if they're targeting Node, so I still think it makes sense for this shim to be defensive about it.