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

@financial-times/useragent_parser

Package Overview
Dependencies
Maintainers
9
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/useragent_parser

This is the VCL & JS implementation of the [ua-parser](https://github.com/tobie/ua-parser)

  • 1.6.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39K
increased by19.17%
Maintainers
9
Weekly downloads
 
Created
Source

User Agent parser in VCL & JS

This is the VCL & JS implementation of the ua-parser

Usage

Updating

uap-core definitions are, by default, compiled and included in the package. Updating uap-core is done every day via a GitHub Action.

Example in VCL

For a request which was the user-agent Chrome 71.1:

import ua_parser;

sub vcl_recv {
  call useragent_parser;
  # req.http.useragent_parser_family = "chrome";
  # req.http.useragent_parser_major = "71";
  # req.http.useragent_parser_minor = "1";
  # req.http.useragent_parser_patch = "0";
}

Example in JS

const useragent = require('@financial-times/useragent_parser');

console.log(useragent(request.headers['user-agent']))
/*
  {
    family: 'chrome',
    major: 71,
    minor: 1,
    patch: 0
  }
*/

FAQs

Package last updated on 05 Apr 2022

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