Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Cross-platform environment detection library for JavaScript
JavaScript
branch: master

Merge pull request #1 from node-migrator-bot/clean

Hi! I fixed some calls to "sys" for you!
latest commit 57a2f7b830
@azer authored
Failed to load latest commit information.
lib fix opera bug
test [fix] Changed require('sys') to require('util') for compatibility wit…
COPYING add license
README.md v1.3.0
package.json fix opera bug

README.md

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

Install

Usage

On Browsers:

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

> environ()
{ chrome: true, dom: true, gecko: true, navigator: true, safari: true, v8: true, webkit: true }
> environ.node()
false
> environ.dom()
true
> environ.v8()
true
> environ.webkit()
true

On a CommonJS compliant platform:

> var environ = require('environ');

> environ()
{ linux: true, modules: true, node: true, v8: true }
> environ.packages()
true
> environ.node()
true
> environ.dom()
false
> environ.v8()
true
> environ.webkit()
false

Available Methods

  • dom
  • chrome
  • firefox
  • gecko
  • jsc
  • ie
  • ie6
  • ie7
  • ie8
  • ie9
  • ie10
  • kindle
  • linux
  • modules
  • 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.