itunes-info

0.5.0 • Public • Published

iTunes-info

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

// 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

Package Sidebar

Install

npm i itunes-info

Weekly Downloads

4

Version

0.5.0

License

MIT

Last publish

Collaborators

  • jense5