Catalog npm
Back to packageRELEASE DETAILS

1.3.8

npm

51degrees

51degrees c-sdk native bindings for nodejs

Published3 Dec 2014
Direct dependencies5
Transitive dependenciesNot calculated

README

Current package documentation

51degrees.node

![Gitter](https://badges.gitter.im/Join Chat.svg)

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, options])
  • filename {String} your 51degrees data, lite or premium.

  • properties {Array} optional, required properties

  • options {Object}

  • options.autoUpdate {Boolean} enable/disable autoUpdate feature

  • options.key {String} auto-update requires a licesen key from 51Degrees

  • options.interval {Integer}, default value 30 * 60 * 1000 (half hours)

  • options.onupdated {Function} if auto updated, you will get call at this function

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);
Create an auto-updated pattern parser
var psr = new Parser('51Degrees-Lite.dat', [], {
  autoUpdate: true,
  key: 'your license key'
});

Note: this feature only is used at pattern data.

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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 5

Native requirements
5 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
nan
Environment
{
  "local_name": "nan",
  "alias": false,
  "peer_metadata": null
}
^1.3.0runtime
csv
Environment
{
  "local_name": "csv",
  "alias": false,
  "peer_metadata": null
}
^0.4.0development
tape
Environment
{
  "local_name": "tape",
  "alias": false,
  "peer_metadata": null
}
^2.14.0development
debug
Environment
{
  "local_name": "debug",
  "alias": false,
  "peer_metadata": null
}
^2.1.0development
microtime
Environment
{
  "local_name": "microtime",
  "alias": false,
  "peer_metadata": null
}
^1.0.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "ca6e28b4078573e2ca88225a62fbd137a70c51de",
  "tarball": "https://registry.npmjs.org/51degrees/-/51degrees-1.3.8.tgz",
  "integrity": "sha512-uF6bBkGzQn58h4YQVqR0U/26iRNSQff2Fsv0diIGWofb3x8aLdmKVe7+cwa2LShH6B86XO/kt4UJ2vUPv3Bq3w==",
  "signatures": [
    {
      "sig": "MEUCIQCjv6pkDUiv/amT6x026hNWU6E6DbklH8Oj2Ym7b5DN2QIgWD7frEtOMZ7FMVJaolY3Wnj8n3lwHfYvdKjqn6rkmy8=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ]
}

Repository

PENDING
51degreesmobi/51degrees.node

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
yorkie/51degress.node

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
yorkie/51degrees.node

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:23 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:8fb3ff64f4e436898e4adbb3a322cefce16bb584561d4e1221d122e5413e50d5

Other collected versions

1.8.19 Sept1.8.08 Sept1.5.211 Mar1.5.111 Mar1.5.011 Mar1.3.105 DecView all collected versions →