# iTunes-info

<img src="https://img.shields.io/npm/v/itunes-info.svg">
<img src="https://travis-ci.org/Jense5/itunes-info.svg?branch=master">
<img src="https://img.shields.io/npm/dt/itunes-info.svg">
<img src="https://img.shields.io/npm/l/itunes-info.svg">

Simple util to fetch data from iTunes with a Promise.

#### Use the command line tool

```
$ npm install -g itunes-info
$ itunes-info "Martin Garrix - Animals"
# Info will be printed...
```

#### Use it in your own project

```
$ npm install --save itunes-info
# or
$ yarn add itunes-info
```

#### ES6 Example

```js
// Import iTunes instance
import { iTunes } from 'itunes-info';

// Fetch any data you need from iTunes!
iTunes.fetch('Avicii - Hey Brother')
      .then((data) => {
        console.log(JSON.stringify(data, null, 4));
      }).catch((error) => { console.error(error); });

// For example, use it to detect which kind of media
// you are working with by passing the filename as a query.
// For example, when working with friends.mp4
iTunes.fetch('friends')
      .then((data) => {
        // Will print: 'tv-episode'.
        console.log(data.results[0].kind);
      }).catch((error) => { consoler.error(error); })

// You can also provide optional two-letter country code.
iTunes.fetch('kraantje pappie', 'BE');

// Just print the data instance to see all the data you get.

```

Distributed under **MIT** - [Jensen Bernard](https://github.com/Jense5)
