New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

edgescape-parser

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edgescape-parser

Middleware for parsing the Akamai EdgeScape header

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by225%
Maintainers
1
Weekly downloads
 
Created
Source

edgescape-parser

Middleware for parsing the Akamai EdgeScape header

Install

$ npm install --save edgescape-parser

Usage

var express = require('express');
var edgescapeParser = require('edgescape-parser');

var app = express();

app.use(edgescapeParser());

app.get('/:country_code?', function(req, res) {

  // redirect homepage to country code
  if(_.isUndefined(req.params.country_code)) {
    var country_code = req.akamai.edgescape.country_code.toLowerCase() || 'us';
    res.redirect(302, '/' country_code);
  } else {
    // Render country specific page
  }

});

API

edgescapeParser([options])

options
header

Type: string
Default: x-akamai-edgescape

Parses the header into a JSON object containing all of the EdgeScape variables.

Attribute NameAvailabilityValue TypeDescription
country_codeglobalstringTwo-letter ISO-3166-1 country code
region_codeglobalstring/integerProvince, region or state code. Not available in all countries.
cityglobalstring
dmaUnited StatesintegerDesignated Marketing Area - the same as the Nielson definition.
pmsaUnited StatesintegerPrimary Metropolitan Statistical Area, a measure by the US government. There is no direct correlation for these measures outside the US.
msaUnited StatesintegerA number representing the Metropolitan Statistical Area.
area codeUnited Statesinteger-array‘+’ delimited array of phone area codes associated with the client IP address.
countyUnitedStates string
fipsUnited StatesintegerNumerical value for the county
latglobalfloatGlobal latitude position
longglobalfloatGlobal longitude position
timezoneglobalstring GMT + offset
zipUnited States + Canadazipcode-range-array‘+’ delimited array of zipcode ranges. ‘-’ indicates the range. Note that this field is based on the ‘city’ field, so that is the current granularity level.
continentglobalstring
throughputglobalstringSee the “Actual Connection Speed (throughput)” file under Support > User and Developer Guides > Content Targeting > Data Codes.
bwglobalintegerProvides additional granularity to the ‘throughput’ field.
asnumglobalinteger-array‘+’ delimited array of Autonomous System (AS) numbers.
networkglobal, select networksstringThe name of the network/ISP that owns the IP address, including wireless carriers. Select networks only.
network_typeglobalstringThe connection type seen in the end user’s request (e.g., dialup, cable, dsl)
proxyglobalstringThis value is set if the IP is a proxy.

License

MIT © MadGlory

FAQs

Package last updated on 15 Apr 2015

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