
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Parse a VMAP XML document to Javascript object. Complies with VMAP 1.0.1 spec.
Install with npm
npm install vmap
Provide the VMAP constructor an XML in order to have a parsed version of it.
Access VMAP properties using the APIs documented below.
import VMAP from 'vmap';
// Fetch VMAP as XML
const xhr = new XMLHttpRequest();
xhr.open('GET', vmapURL);
xhr.send();
xhr.onreadystatechange = function() {
if (xhr.readyState === xhr.DONE) {
if (xhr.status === 200) {
// Get a parsed VMAP object
const vmap = new VMAP(xhr.responseXML);
}
}
};
version: The VMAP version (should be 1.0).adBreaks: An array of VMAPAdBreak objects.extensions: An array of Object with
children: Object containing all this extension children and their name as the keyattribute: Object containing all this extension attributes and their name as the keyvalue: Object parsed from CDATA or as a fallback all of the text nodes of this extension concatenatedProvides information about an ad break.
timeOffset: Represents the timing of the ad break.breakType: Identifies whether the ad break allows "linear", "nonlinear" or "display" ads.breakId: An optional string identifier for the ad break.repeatAfter: An option used to distribute ad breaks equally spaced apart from one another along a linear timeline.adSource: A VMAPAdSource object.trackingEvents: An array of Object with tracking URLs
event: The name of the event to track for the element. Can be one of breakStart, breakEnd or error.uri: The URI of the tracker.extensions: An array of Object with
children: Object containing all this extension children and their name as the keyattribute: Object containing all this extension attributes and their name as the keyvalue: Object parsed from CDATA or as a fallback all of the text nodes of this extension concatenatedtrack(event, errorCode): Call the trackers for the given event with an option error code parameter for error events.Provides the player with either an inline ad response or a reference to an ad response.
id: Ad identifier for the ad source.allowMultipleAds: Indicates whether a VAST ad pod or multple buffet of ads can be served into an ad break.followRedirects: Indicates whether the video player should honor the redirects within an ad response.vastAdData: Contains an embedded VAST response.adTagURI: Contains a URI to the VAST.customData: Contains custom ad data.The library is 100% written in JavaScript and the source code uses modern features like modules, classes, ecc... . Make sure your environment supports these features, or transpile the library when bundling your project.
We provide several pre-bundled versions of the library (see dist directory)
A pre-bundled version of VMAP-jsis available: vmap-js.js.
You can add the script directly to your page and access the library through the VMAP constructor.
<script src="dist/vmap-js.js"></script>
var vmap = new VMAP(vmapXML);
A pre-bundled version for node is available too: vmap-js-node.js.
const VMAP = require('vmap')
const vmap = new VMAP(vmapXML);
Install dependencies with:
npm install
The project is bundled using Rollup. Build with:
npm run-script build
Run tests with:
npm test
FAQs
Javascript VMAP Parser
The npm package vmap receives a total of 335 weekly downloads. As such, vmap popularity was classified as not popular.
We found that vmap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.