Socket
Socket
Sign inDemoInstall

@mocivnik10/easy-twitch

Package Overview
Dependencies
5
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mocivnik10/easy-twitch


Version published
Weekly downloads
1
Maintainers
1
Install size
373 kB
Created
Weekly downloads
 

Readme

Source

@mocivnik10/easy-twitch

GitHub license

Install

$ npm install @mocivnik10/easy-twitch 

Twitch Client ID

To make API calls, you need a client ID. Create one by following the guide here:

Example Usage

const CLIENT_ID = 'YOUR_KEY_HERE'

const EasyTwitch = require('@mocivnik10/easy-twitch')
const api = new EasyTwitch(CLIENT_ID);

const chalk = require('chalk');

main = async () => {
  const games = await api.games()
  console.log(chalk.yellow("CURRENTLY TOP GAMES"))
  console.log("-------------")
  games.forEach((item, _) => {
    console.log(item.name)
  })
  console.log()

  const topGame = games[0]
  const streamers = await api.streamers(topGame.id)

  console.log(chalk.yellow("TOP GAME: " + topGame.name))
  console.log("-------------")

  streamers.forEach((item, _) => {
    console.log(item.user_name + " - " + item.viewer_count + " viewers")
  })
}

main()

Keywords

FAQs

Last updated on 24 Oct 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc