Socket
Book a DemoInstallSign in
Socket

device-detect

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

device-detect

JavaScript module to check if user agent to return the device and browser.

1.0.7
latest
Source
npmnpm
Version published
Weekly downloads
4.2K
10.64%
Maintainers
1
Weekly downloads
 
Created
Source

Device Detect

JavaScript module to check if user agent to return the device and browser.

Install

npm install device-detect --save-dev

Use

var deviceDetect = require('device-detect')();

// return all device and browser object
console.log(deviceDetect);

// result example:
/* {
  "device":"Macintosh",
  "browser":"Chrome"
} */

console.log(deviceDetect.device); // returns Macintosh
console.log(deviceDetect.browser); // returns Chrome

Supported

Devices:

  • iPhone
  • iPad
  • iPod
  • Blackberry
  • WindowsMobile
  • Android
  • Macintosh
  • Windows
  • Linux

Browsers:

  • Chrome
  • Opera
  • Firefox
  • IE
  • Safari

Release History

  • 1.0.6: Add test.js.
  • 1.0.6: Add Linux detection.
  • 1.0.5: Update documentation.
  • 1.0.4: Add support for Windows Mobile.
  • 1.0.3: Update documentation.
  • 1.0.2: Update description.
  • 1.0.1: Update documentation.
  • 1.0.0: Initial release.

Contributing

  • Fork it
  • Run npm install
  • Run Grunt watch grunt watch
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am "Add some feature")
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

License

MIT © Ryan Burgess

Keywords

javascript

FAQs

Package last updated on 18 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.