tvdb-client
v1.0.0
Published
Abstraction layer for thetvdb.com API
Downloads
3
Readme
TVDB API
This module provides an abstraction layer to thetvdb.com API (which returns XML documents). It allows you to perform hits against the API with Javascript class methods and converts all the results from XML to JSON.
Installation
npm install tvdb-client
Usage
This module allows you to search for a serie with two methods:
- findById
- findByName
Below is a quick example of how to use the findByName method inside your Express app:
var express = require('express'),
app = express(),
api = require('tvdb-client')('YOUR_API_KEY');
app.get('/', function(req, res) {
var show = api.findByName('The Big Bang Theory');
res.end({ serie: show });
});
app.listen(3000);
Make sure to add your API key as an argument to the module otherwise your request won't be processed by the API.
Tests
Tests are written using the Mocha framework and the Chai && Chai as Promised libraries.
TODO
- Mock the API calls inside the tests
- Allow user to perform search in other langages
Contributions
Contributions are more than welcome as long as they include tests.