Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azer/environ
Cross-platform environment detection library for JavaScript
https://github.com/azer/environ
Last synced: 11 days ago
JSON representation
Cross-platform environment detection library for JavaScript
- Host: GitHub
- URL: https://github.com/azer/environ
- Owner: azer
- License: wtfpl
- Created: 2011-05-29T22:22:05.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-06-24T03:17:34.000Z (over 12 years ago)
- Last Synced: 2024-08-02T05:22:06.091Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 111 KB
- Stars: 32
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
Cross platform environment detection library for JavaScript. Tested platforms; Node, Firefox 4, Chrome 12, IE8
Install
=======
* npm install environ
* curl https://github.com/azer/environ/raw/master/lib/environ.jsUsage
=====
On Browsers:
> 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()
trueOn 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()
falseAvailable Methods
=================
* dom
* chrome
* firefox
* gecko
* jsc
* ie
* ie6
* ie7
* ie8
* ie9
* ie10
* kindle
* linux
* modules
* navigator
* node
* mobile
* opera
* safari
* webkit
* v8Testing
=======
* node test/node.js
* w3 test/browser.html