Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twitch-api-lite

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitch-api-lite - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

32

index.js

@@ -12,3 +12,3 @@ const request = require("request");

*/
isTwitchUserLive(clientID, streamerUsername)
isStreamerLiveByUsername(clientID, streamerUsername)
{

@@ -33,4 +33,34 @@ return new Promise(function (fulfill, reject)

})
},
/**
* Returns the public data for a streamer queried by their username. An empty array will
* be returned if the streamer is not live
*
* @param clientID your twitch app client id
* @param streamerUsername the users stream url extension eg: twitch.tv/inflamesforever
* @returns {Promise<JSON Object>}
*/
getStreamDetailsByUsername(clientID, streamerUsername)
{
return new Promise(function (fulfill, reject)
{
try
{
request({
headers: {
'Client-ID': clientID
}, uri: 'https://api.twitch.tv/helix/streams?user_login=' + streamerUsername, method: 'GET'
}, function (url, res, body)
{
fulfill(JSON.parse(body).data)
})
}
catch (ex)
{
reject(ex)
}
})
}
};

2

package.json
{
"name": "twitch-api-lite",
"version": "0.0.2",
"version": "0.0.3",
"description": "This package provides small lightweight functions that are to be used with the Twitch API v5",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc