New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.1 to 0.0.2

39

index.js

@@ -9,30 +9,27 @@ const request = require("request");

* @param clientID your twitch app client id
* @param user_login the users stream url extension eg: twitch.tv/inflamesforever
* @param streamerUsername the users stream url extension eg: twitch.tv/inflamesforever
* @returns {Promise<Boolean>}
*/
isTwitchUserLive(clientID, user_login)
isTwitchUserLive(clientID, streamerUsername)
{
return new Promise(
function (fulfill, reject)
return new Promise(function (fulfill, reject)
{
try
{
try
request({
headers: {
'Client-ID': clientID
}, uri: 'https://api.twitch.tv/helix/streams?user_login=' + streamerUsername, method: 'GET'
}, function (url, res, body)
{
request({
headers: {
'Client-ID': clientID
},
uri: 'https://api.twitch.tv/helix/streams?user_login=' + user_login,
method: 'GET'
}, function (url, res, body)
{
fulfill(JSON.parse(body).data.length !== 0)
})
}
catch (ex)
{
reject(ex)
}
})
fulfill(JSON.parse(body).data.length !== 0)
})
}
catch (ex)
{
reject(ex)
}
})
}
};
{
"name": "twitch-api-lite",
"version": "0.0.1",
"version": "0.0.2",
"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