Parses VAST files into plain Javascript objects
JavaScript HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Dependency Status

Parses VAST files into plain javascript objects


The library currently makes use of the current projects and is dependent on them:


The main module to use is vastAdManager which exposes two functions:

  • requestVastChain
  • addEventListener


The requestVastChain returns a promise and will resolve once it has finished downloading all of the VAST files in the chain. It returns a VastResponse object.

    .fail(function(vastError) {
        // handle any errors that may have occurred such as an HTTP 404.
    .then(function(vastResponse) {
        // use the vastResponse


It is possible to register event listeners for when a request is about to be made and when it has finished.

  • requestStart - start of request for VAST file
  • requestEnd - end of request for VAST file

These events can be useful for logging purposes or for timing how long each request takes.

Each event passes has the following properties available:

  • requestNumber - the current request number, which can be more than one when VAST wrapper files are used
  • uri - the URI for the request
  • vastResponse - the VastResponse object that is being added to while following a chain of VAST files.

Running Tests

In one terminal run

npm start

Then go to http://localhost:8000/test/phantom/testrunner.html in your browser. Or run npm test


License information can be found in the LICENSE file.