Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Cross-platform environment detection library for JavaScript
JavaScript
tree: 68ecba210e

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
README.markdown
package.json

README.markdown

Cross platform environment detection library for JavaScript. Tested platforms; Node, Firefox 4, Chrome 12

Install

npm install environ

Usage

On Browsers:

<script src="environ.js"></script>

> environ.node()
false
> environ.dom()
true
> environ.v8()
true
> environ.webkit()
true

On a CommonJS compliant platform:

> var environ = require('environ');
> environ.node()
true
> environ.dom()
false
> environ.v8()
true
> environ.webkit()
false

Available Methods

  • dom
  • firefox
  • gecko
  • jsc
  • ie
  • linux
  • navigator
  • node
  • mobile
  • opera
  • safari
  • webkit
  • v8

Testing

node test/node.js w3 test/browser.html

Something went wrong with that request. Please try again.