<commit_before># iTunes React Native

Access your iTunes library (iOS only)

## Installation

In the command line, first you need to install react-native-itunes:

```javascript
npm install react-native-itunes --save
```

In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name] Go to node_modules ➜ react-native-itunes and add the .xcodeproj file

In XCode, in the project navigator, select your project. Add the lib*.a from the deviceinfo project to your project's Build Phases ➜ Link Binary With Libraries Click .xcodeproj file you added before in the project navigator and go the Build Settings tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for Header Search Paths and make sure it contains both ```$(SRCROOT)/../react-native/React``` and ```$(SRCROOT)/../../React``` - mark both as recursive.

Run your project (Cmd+R)

## Example

### Get all tracks
```js
var iTunes = require('react-native-itunes');
iTunes.getTracks().then((tracks) => {
  console.log(tracks);
});

```
### Get all tracks and extract only genre and title
```js
var iTunes = require('react-native-itunes');
iTunes.getTracks({
  fields: ['title', 'genre']
}).then((tracks) => {
  console.log(tracks);
});

```
### Filter track by title and album artist
```js
var iTunes = require('react-native-itunes');
iTunes.getTracks({
  query: {
    title: 'digital',
    albumArtist: 'daft'
  }
}).then((tracks) => {
  console.log(tracks);
});

```
<commit_msg>add rnpm instructions / example update ES6<commit_after># iTunes React Native

Access your iTunes library (iOS only)

## Installation

In the command line, first you need to install react-native-itunes:

```shell
npm install react-native-itunes --save
```

## Automatically link

#### With React Native 0.27+

```shell
react-native link react-native-device-info
```

#### With older versions of React Native

You need [`rnpm`](https://github.com/rnpm/rnpm) (`npm install -g rnpm`)

```shell
rnpm link react-native-device-info
```

## Manually link

In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name] Go to node_modules ➜ react-native-itunes and add the .xcodeproj file

In XCode, in the project navigator, select your project. Add the lib*.a from the deviceinfo project to your project's Build Phases ➜ Link Binary With Libraries Click .xcodeproj file you added before in the project navigator and go the Build Settings tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for Header Search Paths and make sure it contains both ```$(SRCROOT)/../react-native/React``` and ```$(SRCROOT)/../../React``` - mark both as recursive.

Run your project (Cmd+R)

## Example

### Get all tracks
```js
import iTunes from 'react-native-itunes';

iTunes.getTracks().then((tracks) => {
  console.log(tracks);
});

```
### Get all tracks and extract only genre and title
```js
import iTunes from 'react-native-itunes';

iTunes.getTracks({
  fields: ['title', 'genre']
}).then((tracks) => {
  console.log(tracks);
});

```
### Filter track by title and album artist
```js
import iTunes from 'react-native-itunes';

iTunes.getTracks({
  query: {
    title: 'digital',
    albumArtist: 'daft'
  }
}).then((tracks) => {
  console.log(tracks);
});

```

{'fraction_non_alphanumeric': 0.14171779141104293, 'fraction_numerical': 0.001226993865030675, 'mean_word_length': 4.319738988580751, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2420456', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1009, 'n_words': 383}