vast-parser

Parses VAST files into plain javascript objects

Requirements

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

Usage

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

requestVastChain

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.

vastAdManager.requestVastChain('http://example.com/vast-file.xml')
    .fail(function(vastError) {
        // handle any errors that may have occurred such as an HTTP 404.
    })
    .then(function(vastResponse) {
        // use the vastResponse
    });

addEventListener

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

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

Each event passes has the following properties available:

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

License information can be found in the LICENSE file.