Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
![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.
Windows | Mac/Linux |
---|---|
.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.
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);
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.
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
$ npm install 51degrees --save
FAQs
51degrees c-sdk native bindings for nodejs
The npm package 51degrees receives a total of 13 weekly downloads. As such, 51degrees popularity was classified as not popular.
We found that 51degrees demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.