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

byte-api

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

byte-api - npm Package Compare versions

Comparing version 1.2.4 to 1.3.0

13

package.json
{
"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

4

src/constructors/client.js
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()

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