{"_id":"detect.js","_rev":"4-9bdf0f47c541f4f0fa32d41d8a1fa700","name":"detect.js","description":"JS Library to detect browser, os and device based on the UserAgent String, forked by John Carmichael for ease of use.","dist-tags":{"latest":"2.2.3"},"versions":{"2.2.2":{"name":"detect.js","version":"2.2.2","author":{"name":"Darcy Clarke"},"license":"Dual licensed under the MIT and GPL licenses.","description":"JS Library to detect browser, os and device based on the UserAgent String, forked by John Carmichael for ease of use.","main":"detect.js","scripts":{"start":"node build/build.js --input build/detect.js --output detect.js --package package.json && node build/build.js --input build/detect.js --output detect.min.js --minify --package package.json && node scripts/update_readme_version.js README.md"},"repository":{"type":"git","url":"git+https://github.com/darcyclarke/Detect.js.git"},"keywords":["detect","user-agent","parse","parsing","useragent","detection"],"devDependencies":{"optimist":"~0.4","uglify-js":"~2.2","yamlparser":">=0.0.2","mocha":"*"},"gitHead":"41643bd1744c71f0293775444cf7a9b753448f50","bugs":{"url":"https://github.com/darcyclarke/Detect.js/issues"},"homepage":"https://github.com/darcyclarke/Detect.js#readme","_id":"detect.js@2.2.2","_shasum":"6a49b4dda0c3d54ddb3f2253c86b75419f29a746","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"johncarmichael","email":"johncarmichael1984@gmail.com"},"dist":{"shasum":"6a49b4dda0c3d54ddb3f2253c86b75419f29a746","tarball":"https://registry.npmjs.org/detect.js/-/detect.js-2.2.2.tgz","integrity":"sha512-xHKoUgB9138YxAtJG/kkxjigetJbmqq4QWOEHgPu/P0wPSzUdkRpddYGaDc7GycsihxybUbDylmhDbltTCTCYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRfd+uqGG5xW4u4zORCeAqTIuOQ17gZlISN11LT0CBVwIhAKgjns6lQDrHZhHFZcd93VUvPgRMy+NLwObh3La6fZf7"}]},"maintainers":[{"name":"johncarmichael","email":"johncarmichael1984@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/detect.js-2.2.2.tgz_1494277736915_0.04721493483521044"},"directories":{}},"2.2.3":{"name":"detect.js","version":"2.2.3","author":{"name":"Darcy Clarke"},"license":"Dual licensed under the MIT and GPL licenses.","description":"JS Library to detect browser, os and device based on the UserAgent String, forked by John Carmichael for ease of use.","main":"detect.js","scripts":{"start":"node build/build.js --input build/detect.js --output detect.js --package package.json && node build/build.js --input build/detect.js --output detect.min.js --minify --package package.json && node scripts/update_readme_version.js README.md"},"repository":{"type":"git","url":"git+https://github.com/darcyclarke/Detect.js.git"},"keywords":["detect","user-agent","parse","parsing","useragent","detection"],"devDependencies":{"optimist":"~0.4","uglify-js":"~2.2","yamlparser":">=0.0.2","mocha":"*"},"gitHead":"56ed8129dd91ed939ecd5bd77943dea814d58d41","bugs":{"url":"https://github.com/darcyclarke/Detect.js/issues"},"homepage":"https://github.com/darcyclarke/Detect.js#readme","_id":"detect.js@2.2.3","_shasum":"18a00621f959c5ebdcbb84267e1a75442f414ea9","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"johncarmichael","email":"johncarmichael1984@gmail.com"},"dist":{"shasum":"18a00621f959c5ebdcbb84267e1a75442f414ea9","tarball":"https://registry.npmjs.org/detect.js/-/detect.js-2.2.3.tgz","integrity":"sha512-awS0dy7wPpzoF20kZPjg2yI1RONXXdq/hbA2CJ8BMsO2I1CSm4NdlVEI1YaRh20Xyxoaki/V4aV+mVAldT9aQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9M5+xt4BxRuljii9CN1fyIea4D7hXwsGXTFQUIb+7DAIgMcDueN1hd/IGBc9QXU1YQHO7N+2E+iriMv+ZwSIk4dY="}]},"maintainers":[{"name":"johncarmichael","email":"johncarmichael1984@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/detect.js-2.2.3.tgz_1494782338831_0.8205763010773808"},"directories":{}}},"readme":"Detect.js\n=========\n\n**Note:** Detect.js is a JavaScript library to detect platforms, versions, manufacturers and types based on the `navigator.userAgent` string. This code is based on, and modified from, the original work of Tobie Langel's UA-Parser: https://github.com/tobie/ua-parser. UA-Parser is subsequently a port of [BrowserScope][1]'s [user agent string parser][2].\n\nAs initially touted, the biggest contribution to this code is the work of Steve Souders and the list of regex tests.\n\nFeatures\n--------\n\n* User-Agent parsing (obviously)\n* AMD/Common.js support\n* **device**, **os** and **browser** detection of:\n\t* `name`\n\t* `family`\n\t* `version`\n\t* `major`\n\t* `minor`\n\t* `patch`\n\t* **device** supports: `manufacturer` and `type` as well\n* Custom regex builds using **node.js**\n\n\nCreating a Custom Build\n-----------\n\nCreating a custom build of the regex profiles will help reduce file size and is strongly recommended. The default `detect.js` and `detect.min.js` files include **all** regex profiles and is therefor much larger then, I'm sure, your needs.\n\n1. Install **Node.js**: https://github.com/joyent/node/wiki/Installation\n2. Edit  `build/config.js` with you're preferred **oss**, **devices** and **browsers**\n3. Run `node build/build.js --input=build/detect.js --output=build/detect.custom.js`\n4. The build script should create a custom version of **Detect.js** at `build/detect.custom.js`\n\n\nExample Use\n-----------\n#### Plain JS:\n```html\n<script src=\"detect.js\"></script>\n````\n\n```javascript\n\n/*\niPhone 4 Example User Agent:\nMozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7\n*/\n\nvar ua = detect.parse(navigator.userAgent);\n\nua.browser.family // \"Mobile Safari\"\nua.browser.name // \"Mobile Safari 4.0.5\"\nua.browser.version // \"4.0.5\"\nua.browser.major // 4\nua.browser.minor // 0\nua.browser.patch // 5\n\nua.device.family // \"iPhone\"\nua.device.name // \"iPhone\"\nua.device.version // \"\"\nua.device.major // null\nua.device.minor // null\nua.device.patch // null\nua.device.type // \"Mobile\"\nua.device.manufacturer // \"Apple\"\n\nua.os.family // \"iOS\"\nua.os.name // \"iOS 4\"\nua.os.version // \"4\"\nua.os.major // 4\nua.os.minor // 0\nua.os.patch // null\n````\n\n#### Common.js:\n\n```javascript\nvar detect = require('detect');\nvar ua = detect.parse(navigator.userAgent);\n...\n````\n\nHacking\n-------\n* Install development dependencies using `npm install`.\n* Install the pre-commit hook by running `hooks/install.sh`.\n* Kick off the default build (which will generate `detect.js` and `detect.min.js`) with `npm start`.\n\nCredits\n-------\nThanks to [Adriano Caheté](https://github.com/AdrianoCahete) and [Julian](https://github.com/julmot)\n\nLicensing\n---------\n * Some data contained in `build/regexes.js` is Copyright 2009 Google Inc. and available under the Apache License, Version 2.0.\n * All other code is licensed under a Dual MIT and GPL licence\n\n[1]: http://www.browserscope.org\n[2]: http://code.google.com/p/ua-parser/\n","maintainers":[{"email":"darcy@darcyclarke.me","name":"darcyclarke"}],"time":{"modified":"2022-06-15T01:59:55.033Z","created":"2017-05-08T21:08:58.919Z","2.2.2":"2017-05-08T21:08:58.919Z","2.2.3":"2017-05-14T17:19:00.062Z"},"homepage":"https://github.com/darcyclarke/Detect.js#readme","keywords":["detect","user-agent","parse","parsing","useragent","detection"],"repository":{"type":"git","url":"git+https://github.com/darcyclarke/Detect.js.git"},"author":{"name":"Darcy Clarke"},"bugs":{"url":"https://github.com/darcyclarke/Detect.js/issues"},"license":"Dual licensed under the MIT and GPL licenses.","readmeFilename":"README.md"}