Comparing version 0.2.0 to 0.2.2
{ | ||
"name": "twitchapi", | ||
"description": "A lightweight api wrapper for Twitch API", | ||
"version": "0.2.0", | ||
"version": "0.2.2", | ||
"main": "./lib", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -32,15 +32,29 @@ ## TwitchAPI Wrapper | ||
import Twitch from 'twitchapi'; | ||
var Twitch = require('twitchapi').default; | ||
var TwitchAPI = new Twitch('API_CLIENT_ID'); | ||
const TwitchAPI = new Twitch('API_CLIENT_ID'); | ||
TwitchAPI.search('streams', { query: 'Halo' }) | ||
.then((results) => { | ||
console.log(results); | ||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
}); | ||
TwitchAPI.Search('streams', { query: 'Halo' }) | ||
.then((results) => { | ||
console.log(results); | ||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
}); | ||
How to use (es6): | ||
import Twitch from 'twitchapi'; | ||
const TwitchAPI = new Twitch('API_CLIENT_ID'); | ||
TwitchAPI.search('streams', { query: 'Halo' }) | ||
.then((results) => { | ||
console.log(results); | ||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
}); | ||
**You can refer to the [twitch api documention](https://github.com/justintv/Twitch-API/tree/master/v3_resources) for more details on configuration for the routes (ex. query, limit, offset, etc)** | ||
**Better documentation will exist soon.** |
23851
60