detector-js

WebJar for detector-js

License

License

MIT
Categories

Categories

JavaScript Languages
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

detector-js
Last Version

Last Version

1.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

detector-js
WebJar for detector-js
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/blackmirror1980/detector-js

Download detector-js

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/detector-js/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>detector-js</artifactId>
    <version>1.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/detector-js/
implementation 'org.webjars.npm:detector-js:1.2.1'
// https://jarcasting.com/artifacts/org.webjars.npm/detector-js/
implementation ("org.webjars.npm:detector-js:1.2.1")
'org.webjars.npm:detector-js:jar:1.2.1'
<dependency org="org.webjars.npm" name="detector-js" rev="1.2.1">
  <artifact name="detector-js" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='detector-js', version='1.2.1')
)
libraryDependencies += "org.webjars.npm" % "detector-js" % "1.2.1"
[org.webjars.npm/detector-js "1.2.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

detector-js

v1.2.2

Description

DetectorJS, zero-dependency platform/environment detector written in ES6

Please feel free to ask for modifications, fixes or do a PR to improve Detector behavior or add detection rules

Author

Black Mirror

Badges

NPM

NPM downloads/month GitHub stars GitHub forks GitHub issues GitHub license Build Status Coverage Status

Documentation

Check out the Latest Documentation here

Installation

This is a Node.js module available through the npm registry.

It can be installed using either npm or yarn package managers.

npm i detector-js
yarn add detector-js

Usage

import Detector from 'detector-js';

const detector = new Detector('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15');

console.log(detector);
// {
//   engine:{
//     name:'WebKit',
//     version:'605.1.15'
//   },
//   browser:{
//     name:'Safari',
//     version:'12.0.3'
//   },
//   os:{
//     name:'macOS',
//     version:'10.14.3',
//     versionName:'Mojave'
//   },
//   cpu:{
//     platform:'MacIntel',
//     cores:1,
//     architecture:'x64',
//     vendor:'intel'
//   },
//   gpu:{
//     webGLVendor:'WebKit',
//     webGLRenderer:'WebKit WebGL',
//     vendor:'Intel Inc.',
//     model:'Intel Iris',
//     renderer:'Intel Iris OpenGL Engine'
//   },
//   platform:'desktop',
//     feature: {
//     pointerEnabled:false,
//     pixelRatio:1,
//     pointerLock:true,
//     quirksMode:false,
//     css3D:true,
//     cssTransform:true,
//     cssTransition:true,
//     deviceMotion:false,
//     deviceOrientation:false,
//     contextMenu:false,
//     classList:false,
//     placeholder:true,
//     viewportUnit:true,
//     remUnit:true,
//     canvas:true,
//     svg:true,
//     webGL:true,
//     webVR:false,
//     touch:false,
//     forceTouch:true,
//     srcset:true,
//     sizes:true,
//     pictureElement:true,
//     dialogElement:false,
//     addEventListener:true,
//     asyncScript:true,
//     battery:false,
//     cors:true,
//     deferScript:true,
//     file:true,
//     fileSystem:false,
//     fullscreen:true,
//     fullscreenKeyboard:true,
//     geolocation:true,
//     historyAPI:true,
//     littleEndian:false,
//     localStorage:true,
//     matchMedia:true,
//     querySelector:true,
//     querySelectorAll:true,
//     serviceWorker:true,
//     typedArray:true,
//     userMedia:false,
//     vibration:false,
//     worker:true,
//     audio:{
//       supported:true,
//       context:true,
//       formats:{
//         mp3:true,
//         webm:false,
//         ogg:false,
//         opus:false,
//         wav:true,
//         m4a:true
//       }
//     },
//     video:{
//       supported:true,
//       formats:{
//         mp4:true,
//         ogv:false,
//         webm:false
//       }
//     }
//   }
// }

Todo

  • refine browsers regexes
  • refine documentation
  • implement modular custom build feature
  • decide to implement or not device infos detection

Dependencies

None

Dev Dependencies

Tests

npm install
npm test

License

MIT

Powered By

JS.ORG Logo

Versions

Version
1.2.1