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

51degrees

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

51degrees

51degrees c-sdk native bindings for nodejs

  • 1.3.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

51degrees.node

51degrees c-sdk native bindings for nodejs, it helps you detect devices from userAgent in high performance.

NPM NPM

WindowsMac/Linux
Build statusBuild Status

API

.Parse(filename[, properties])
  • filename {String} your 51degrees data, lite or premium.

  • options {Array} optional, required properties

for more information, you could move to 51degrees documentation

parser.parse(userAgent)
  • userAgent {String}

parse the userAgent given by you, and return result of that.

Usage

var Parser = require('51degrees').Parser;
var psr = new Parser('51Degrees-Lite.dat');
var userAgent = '...'; // your userAgent in any clients(browser/ios/android)
var ret = psr.parse(userAgent);
console.log(ret);

After the above program, you will get:

{ Id: '17595-21721-21635-18092',
  Canvas: true,
  CssTransforms: true,
  CssTransitions: true,
  History: true,
  Html5: true,
  IndexedDB: true,
  IsMobile: false,
  Json: true,
  PostMessage: true,
  Svg: true,
  TouchEvents: true,
  WebWorkers: true,
  method: 'trie',
  data: {} }
.ALL_PROPERTIES

51Degrees.node exposure ALL_PROPERTIES to shortly fetch all propertites from userAgent, just using like this:

var properties = require('51degrees').ALL_PROPERTIES;
var userAgent = '...' // your userAgent in any clients(browser/ios/android)
var psr = new Parser('51Degrees-Lite.trie', properties);
var ret = psr.parse(userAgent);
console.log(ret);

Then will print the whole properties, it's super useful for overview of this module and 51Degrees product.

Properties

The following list shows all properties that 51degrees would export in json:

  • AnimationTiming
  • BlobBuilder
  • Canvas
  • CssBackground
  • CssBorderImage
  • CssCanvas
  • CssColor
  • CssColumn
  • CssFlexbox
  • CssFont
  • CssImages
  • CssMediaQueries
  • CssMinMax
  • CssOverflow
  • CssPosition
  • CssText
  • CssTransforms
  • CssTransitions
  • CssUI
  • DataSet
  • DataUrl
  • DeviceOrientation
  • FileReader
  • FileSaver
  • FileWriter
  • FormData
  • Fullscreen
  • GeoLocation
  • History
  • Html5
  • Html-Media-Capture
  • Id
  • Iframe
  • IndexedDB
  • IsMobile
  • Json
  • LayoutEngine
  • Masking
  • PostMessage
  • Progress
  • Prompts
  • ScreenPixelsHeight
  • ScreenPixelsWidth
  • Selector
  • Svg
  • TouchEvents
  • Track
  • Video
  • Viewport
  • WebWorkers
  • Xhr

Installation

$ npm install 51degrees --save

License

MPL

FAQs

Package last updated on 30 Oct 2014

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