![]() ![]() ![]() Support detect brands list (1000): Show details Example1 detect device in native server.Micro service detect device from framework moleculer js.log ( 'Result parse code model', result ) /* result */ Others isWearable ( result ) Using parsers singly Detect BotĬonst AliasDevice = require ( 'node-device-detector/parser/device/alias-device' ) const userAgent = 'Mozilla/5.0 (Linux Android 5.0 NX505J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/.78 Mobile Safari/537.36' const aliasDevice = new AliasDevice const result = aliasDevice. isPortableMediaPlayer ( result ) /* check device type watches, headsets */ DeviceHelper. isSmartDisplay ( result ) /* check device type boxes, blu-ray players */ DeviceHelper. isPeripheral ( result ) /* */ DeviceHelper. isCamera ( result ) /* portable terminal, portable projector */ DeviceHelper. isTv ( result ) /* check device type portable camera */ DeviceHelper. isSmartSpeaker ( result ) /* check device type SmartTV/TV box */ DeviceHelper. isConsole ( result ) /* check device type smart speaker (Alisa, Alexa, HomePod etc) */ DeviceHelper. isPhablet ( result ) /* check device type game console (xBox, PlayStation, Nintendo etc) */ DeviceHelper. isSmartphone ( result ) /* check device type phablet */ DeviceHelper. isFeaturePhone ( result ) /* check device type smartphone */ DeviceHelper. isCar ( result ) /* check device type feature phone (push-button telephones) */ DeviceHelper. isTabled ( result ) /* check device type car (side panel in car) */ DeviceHelper. isDesktop ( result ) /* check device type is tablet */ DeviceHelper. isMobile ( result ) /* check device type is desktop */ DeviceHelper. detect ( userAgent ) /* check device type (feature phone, smartphone or phablet) */ DeviceHelper. Const DeviceDetector = require ( 'node-device-detector' ) const DeviceHelper = require ( 'node-device-detector/helpers' ) const detector = new DeviceDetector const userAgent = 'Mozilla/5.0 (Linux Android 5.0 NX505J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/.78 Mobile Safari/537.36' const result = detector. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |