twitch-new-api
Advanced tools
Comparing version 1.2.0 to 2.0.0
{ | ||
"name": "twitch-new-api", | ||
"version": "1.2.0", | ||
"description": "Twitch New Api", | ||
"main": "index.js", | ||
"version": "2.0.0", | ||
"description": "Twitchfa Helix Api Wrapper in TypeScript", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build": "tsc", | ||
"build:watch": "tsc -w", | ||
"start": "nodemon dist/index.js", | ||
"test": "npx jest", | ||
"test:watch": "npx jest --watch" | ||
}, | ||
"keywords": [], | ||
"author": "Soroosh Merajiyan <sorooshmerajiyan@gmail.com> (https://www.linkedin.com/in/sorooshmerajiyan)", | ||
"keywords": [ | ||
"Twitch", | ||
"Helix" | ||
], | ||
"author": "Soroosh Merajiyan", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/jest": "26.0.15", | ||
"@types/node": "14.14.7", | ||
"@types/node-fetch": "2.5.7", | ||
"jest": "26.6.3", | ||
"nodemon": "2.0.6", | ||
"ts-jest": "26.4.4", | ||
"typescript": "4.0.5" | ||
}, | ||
"dependencies": { | ||
"node-fetch": "^2.6.0" | ||
"node-fetch": "2.6.1" | ||
} | ||
} |
@@ -1,37 +0,33 @@ | ||
# Introduction | ||
# Install | ||
a simple package to interact with **Twitch's _new_ API** | ||
``` | ||
npm i twitch-new-api | ||
``` | ||
# How to use | ||
# Basic Usage | ||
```javascript | ||
const TwitchApi = require(`twitch-new-api`); | ||
This package is written in TypeScript, so you can use it in both js and ts. | ||
const clientId = `yourClientId`; | ||
const clientSecret = `yourClientSecret`; | ||
All of the methods are self documented, providing a good developer experience. | ||
const TwitchClient = new TwitchApi(clientId, clientSecret); | ||
```ts | ||
import { TwitchApi, TwitchCredentials } from '../src'; | ||
const twitchCredentials: TwitchCredentials = { | ||
id: 'twitch.client.id', | ||
secret: 'twitch.client.secret', | ||
}; | ||
const twitch = new TwitchApi(twitchCredentials); | ||
(async () => { | ||
let data = await TwitchClient.getUserByLogin(user); | ||
console.log(data); | ||
const user = await twitch.getUserById(['mechiller']); | ||
const profilePicture = user[0].profile_image_url; | ||
})(); | ||
``` | ||
# Methods | ||
# Contribution | ||
```javascript | ||
TwitchClient.getGameById(gameId); // gets Game Name from Game ID - Example: 33214 | ||
TwitchClient.getStreamById(userId); // gets stream data if live by User ID - Example: 12826 | ||
TwitchClient.getStreamByLogin(userLogin); // gets stream data if live by User Login - Example: twitch | ||
TwitchClient.getUserById(userId); // gets user data from User ID - Example: 12826 | ||
TwitchClient.getUserByLogin(userLogin); // gets user data from User Login - Example: twitch | ||
TwitchClient.getAllFollowersToId(userId); // gets all of followers from User ID - Example: 12826 | ||
TwitchClient.getFollowersToId(userId, number); // gets a number followers from User ID - Example: 12826, 20 | ||
TwitchClient.getAllFollowersFromId(userId); // gets all of followings from User ID - Example: 12826 | ||
TwitchClient.getFollowersFromId(userId, number); // gets a number of followings from User ID - Example: 12826, 20 | ||
TwitchClient.getStreamsFromId(ids); // gets an array of live streams from User IDs - Example: [12826, ...] | ||
TwitchClient.getStreamsFromLogin(logins); // gets an array of live streams from User Logins - Example: [12826, ...] | ||
``` | ||
I made this package for my own usage, if you need something specific, please, make an issue or PR. | ||
# License - MIT |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
7
1
1
10743
7
235
34
+ Addednode-fetch@2.6.1(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
Updatednode-fetch@2.6.1