Comparing version 1.2.4 to 1.3.0
{ | ||
"name": "byte-api", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"main": "src/index.js", | ||
@@ -9,4 +9,13 @@ "author": "Furry", | ||
"url": "https://github.com/Furry/byte-api", | ||
"keywords": ["byte", "byte-api", "api", "vine2", "vine", "Bytejs", "tiktok"], | ||
"keywords": [ | ||
"byte", | ||
"byte-api", | ||
"api", | ||
"vine2", | ||
"vine", | ||
"Bytejs", | ||
"tiktok" | ||
], | ||
"dependencies": { | ||
"https-proxy-agent": "^4.0.0", | ||
"node-fetch": "^2.6.0" | ||
@@ -13,0 +22,0 @@ }, |
@@ -0,5 +1,9 @@ | ||
# Byte-API | ||
A simple API Wrapper around the Byte.co app. Single dependancy, utilizing node-fetch as the http client. | ||
A simple API Wrapper around the Byte.co app, utilizing node-fetch as the http client w\ proxy support. | ||
## [Join us on discord](https://discord.gg/n4yqTrt) | ||
## setup | ||
@@ -88,1 +92,3 @@ | ||
If you're better at Javascript then me, feel free to make corrections or tell me how I can do something better! | ||
Some1 please fix this readme file it's so ugly |
const HttpHandler = require("./http"); | ||
module.exports = class Client extends HttpHandler { | ||
constructor(token) { | ||
super(token); | ||
constructor(token, config = {}) { | ||
super(token, config); | ||
@@ -7,0 +7,0 @@ } |
@@ -0,1 +1,2 @@ | ||
const HttpsProxyAgent = require("https-proxy-agent") | ||
const EventEmitter = require("events") | ||
@@ -5,7 +6,9 @@ const fetch = require("node-fetch") | ||
module.exports = class HttpHandler extends EventEmitter { | ||
constructor(authorization, options = {}) { | ||
constructor(authorization, config = {}) { | ||
super() | ||
this.baseurl = "https://api.byte.co/" | ||
this.authorization = authorization | ||
this.config = config | ||
} | ||
@@ -20,2 +23,3 @@ | ||
if (body) options["body"] = JSON.stringify(body) | ||
if (this.config.proxy) options["agent"] = new HttpsProxyAgent(`http://${this.config.proxy}`) | ||
@@ -27,3 +31,3 @@ fetch(this.baseurl+url, options) | ||
case 429: reject(new Errors.APIError("Too Many Requests. You're being rate limited")); break | ||
case 200: | ||
@@ -30,0 +34,0 @@ res.json() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13770
314
93
2
3
+ Addedhttps-proxy-agent@^4.0.0
+ Addedagent-base@5.1.1(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedhttps-proxy-agent@4.0.0(transitive)
+ Addedms@2.1.3(transitive)