Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

detector

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detector

User Agent Detector.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
increased by10.27%
Maintainers
1
Weekly downloads
 
Created
Source

detector

detector 是根据 UserAgent 信息识别客户端的模块,可以用于在服务端处理 UserAgent 识别客户端。

另外有一个更适合在客户端浏览器运行的版本的 detector

使用说明

var detector = require("detector");
var ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36";
console.log(detector.detect(ua));

API

{Object} detector.detect(String userAgent)

根据指定 userAgent 识别客户端信息。

这个 API 延续了基于浏览器运行的版本,但似乎基于 node 的版本无需这么累赘, 请参与讨论

Keywords

FAQs

Package last updated on 29 May 2013

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc