npm detect-browser 3.0.0

latest releases: 5.3.0, 5.2.1, 5.2.0...
5 years ago

(copied from the text of #65)

So this is a reasonably simple change, but one that should have a pretty big impact for people who have been hit with the code path which is returning a false positive on node detection (see #54).

It changes two things:

We do browser detection if at all possible (i.e. navigator is defined). This then falls back to detecting the node environment if that isn't available.

  • Removes the require('os') import for os detection and simply uses process.platform instead. The information won't be as detailed and it's possible that a user of this module may still want to opt to do their own check using the os module. Given that the majority use case is web browser detection though I think that makes sense. Should stop browserify bringing in any shims for the os module also (which is a good thing).

  • Because of point 2 though, I believe we should do a major version bump to 3.0.0 to ensure that no-one that is using detect-browser in an isomorphic way is caught out unexpectedly.

Don't miss a new detect-browser release

NewReleases is sending notifications on new releases.