Socket
Socket
Sign inDemoInstall

omgdotlol

Package Overview
Dependencies
7
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.3 to 0.1.0

26

index.js
const fetch = require('node-fetch');
class Account {
constructor(email, name, created, settings) {
this.email = email;
this.name = name;
this.created = created;
this.settings = settings;
}
}
class Client {
constructor(token) {
constructor(token, url="https://api.omg.lol") {
this.token = token;
this.url = url;
}
async get(url) {
const response = await fetch(url, {
async get(path) {
const response = await fetch(`${this.url}${path}`, {
headers: {
Authorization: `Bearer ${this.token}`,
},
Authorization: `Bearer ${this.token}`
}
});
return response.json();
return await response.json().response;
}
async getAccount() {
const response = await this.get('/account');
return new Account(response.email, response.name, response.created, response.settings);
}
}
module.exports = Client;
{
"name": "omgdotlol",
"version": "0.0.3",
"version": "0.1.0",
"description": "API wrapper for omg.lol",

@@ -5,0 +5,0 @@ "main": "index.js",

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