New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

quickonline

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quickonline - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

4

index.js
module.exports = {
host: require('./src/host'),
bot: require('./src/bot')
host: require('./src/host.js'),
bot: require('./src/bot.js')
}
{
"name": "quickonline",
"version": "1.0.6",
"version": "1.0.7",
"description": "Simple package makes quick.db, online data (it's simple)!",

@@ -17,4 +17,4 @@ "main": "index.js",

"dependencies": {
"superagent": "^6.1.0"
}
}
const superagent = require("superagent");
class bot{
constructor(data) {
if(!data) throw new Error('Missing Server URL, Need Help? http://discord.gg/devs')
this.url = data
function moduleAvailable(name) { // ( i don't own this pog to check if package exist or no forked it from afriend )
try {
require.resolve(name);
return true;
} catch(e){}
return false;
};
if(!moduleAvailable('superagent')) throw new Error('Missing superagent package\n need help? join http://discord.gg/devs\nnpm i superagent')
}
/**
* sets avalue to spefic key on the database
* @param key
* @param valuekey
* @example dbo.set('wow', 'hi')
* null > hi
*/
async set(key, valuekey) {
if(!key) throw new Error('[Key] Missing Data Key\n need help? join http://discord.gg/devs')
if(!valuekey) throw new Error('[Value] Missing data\n need help? join http://discord.gg/devs')
let data = superagent.get(`${this.url}/quickonline/set?set=${key}&value=${valuekey}`)
if(!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
return data;
}
class bot {
constructor(data) {
if (!data) throw new Error('Missing default Array for example go to quickonline.js.org , Need Help? http://discord.gg/devs')
if (!data.url) throw new Error("Missing Database url need help? http://discord.gg/devs")
if (!data.username) throw new Error("Missing Database Username Need help? http://discord.gg/devs")
if (!data.password) throw new Error("Missing Database Password need help? http://discord.gg/devs")
this.url = data
this.username = data.username
this.password = data.password
}
/**
* sets avalue to spefic key on the database
* @param key
* @param valuekey
* @example dbo.set('wow', 'hi')
* null > hi
*/
async set(key, valuekey) {
if (!key) throw new Error('[Key] Missing Data Key\n need help? join http://discord.gg/devs')
if (!valuekey) throw new Error('[Value] Missing data\n need help? join http://discord.gg/devs')
let data = superagent.get(`${this.url}/quickonline/set?set=${key}&value=${valuekey}&username=${this.username}&password=${this.password}`)
if (!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
if ((await data).body === "invaild username") throw new Error("Invaild Username , need help? http://discord.gg/devs")
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs")
/**
* Gets adata from the database
* @param key
* @example dbo.get('wow')
* hi
*/
async get(key) {
let data = superagent.get(`${this.url}/quickonline/get?key=${key || null}`)
if(!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
return (await data).body;
}
/**
* delete adata from the database
* @param key
* @example dbo.delete('omg')
* hi > null
*/
async delete(key) {
let data = superagent.get(`${this.url}/quickonline/delete?key=${key || null}`)
if(!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
return (await data).body;
}
/**
* add more value to key on the database
* @param key
* @param value
* @example dbo.add('math', 500)
* null > 500
* @example dbo.add('math', 290)
* 500 > 790
*/
async add(key, value) {
if(isNaN(value)) throw new Error('Value must be only numbers on dbo.add\n need help? http://discord.gg/devs')
let data = superagent.get(`${this.url}/quickonline/add?add=${key}&value=${value}`)
if(!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
if((await data).body === "string") throw new Error("Key is string, not anumber")
return true;
}
/**
* subtract avalue from akey on database
* @param key
* @param value
* @example dbo.subtract('math', 30)
* 790 > 760
*/
async subtract(key, value){
if(!key) throw new Error("Missing key need help with keys ? join \n http://discord.gg/devs")
if(!value )throw new Error("Missing value need help with values ? join \n http://discord.gg/devs")
if(isNaN(value)) throw new Error('Value must be only numbers on dbo.subtract\n need help? http://discord.gg/devs')
let data = superagent.get(`${this.url}/quickonline/subtract?remove=${key}&value=${value}`)
if(!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
if((await data).body === "string") throw new Error("Value of the key is string not anumber need help with values?\n http://discord.gg/devs")
return true;
}
return data;
}
/**
* Gets adata from the database
* @param key
* @example dbo.get('wow')
* hi
*/
async get(key) {
let data = superagent.get(`${this.url}/quickonline/get?key=${key || null}&username=${this.username}&password=${this.password}`)
if (!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
if ((await data).body === "invaild username") throw new Error("Invaild Username , need help? http://discord.gg/devs")
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs")
/**
* fetch key from the database
* @param key
* @example dbo.fetch('omg')
* { key: "omg", data: null }
*/
async fetch(key) {
if(!key) throw new Error("Missing data key need help?\n join http://discord.gg/devs")
let data = superagent.get(`${this.url}/quickonline/fetch?key=${key}`)
if(!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
return (await data).body
return (await data).body;
}
/**
* delete adata from the database
* @param key
* @example dbo.delete('omg')
* hi > null
*/
async delete(key) {
let data = superagent.get(`${this.url}/quickonline/delete?key=${key || null}&username=${this.username}&password=${this.password}`)
if (!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
if ((await data).body === "invaild username") throw new Error("Invaild Username , need help? http://discord.gg/devs")
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs")
return (await data).body;
}
/**
* add more value to key on the database
* @param key
* @param value
* @example dbo.add('math', 500)
* null > 500
* @example dbo.add('math', 290)
* 500 > 790
*/
async add(key, value) {
if (isNaN(value)) throw new Error('Value must be only numbers on dbo.add\n need help? http://discord.gg/devs')
let data = superagent.get(`${this.url}/quickonline/add?add=${key}&value=${value}&username=${this.username}&password=${this.password}`)
if (!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
if ((await data).body === "invaild username") throw new Error("Invaild Username , need help? http://discord.gg/devs")
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs")
if ((await data).body === "string") throw new Error("Key is string, not anumber")
return true;
}
/**
* subtract avalue from akey on database
* @param key
* @param value
* @example dbo.subtract('math', 30)
* 790 > 760
*/
async subtract(key, value) {
if (!key) throw new Error("Missing key need help with keys ? join \n http://discord.gg/devs")
if (!value) throw new Error("Missing value need help with values ? join \n http://discord.gg/devs")
if (isNaN(value)) throw new Error('Value must be only numbers on dbo.subtract\n need help? http://discord.gg/devs')
let data = superagent.get(`${this.url}/quickonline/subtract?remove=${key}&value=${value}&username=${this.username}&password=${this.password}`)
if (!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
if ((await data).body === "invaild username") throw new Error("Invaild Username , need help? http://discord.gg/devs")
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs")
if ((await data).body === "string") throw new Error("Value of the key is string not anumber need help with values?\n http://discord.gg/devs")
return true;
}
/**
* fetch key from the database
* @param key
* @example dbo.fetch('omg')
* { key: "omg", data: null }
*/
async fetch(key) {
if (!key) throw new Error("Missing data key need help?\n join http://discord.gg/devs")
let data = superagent.get(`${this.url}/quickonline/fetch?key=${key}&username=${this.username}&password=${this.password}`)
if (!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
if ((await data).body === "invaild username") throw new Error("Invaild Username , need help? http://discord.gg/devs")
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs")
return (await data).body
}
/**
* @example
* check if the url working or no
*/
async check() {
let data = superagent.get(`${this.url}/quickonline/check&username=${this.username}&password=${this.password}`)
if (!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
if ((await data).body === "invaild username") throw new Error("Invaild Username , need help? http://discord.gg/devs")
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs")
return (await data).body
}
/**
* fetch all the data from the database
* @param
* @example dbo.all()
*/
async all() {
let data = superagent.get(`${this.url}/quickonline/all&username=${this.username}&password=${this.password}`)
if (!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
if ((await data).body === "invaild username") throw new Error("Invaild Username , need help? http://discord.gg/devs")
if ((await data).body === "invaild password") throw new Error("Invaild Password , need help? http://discord.gg/devs")
return data;
}
}
/**
* @example
* check if the url working or no
*/
async check() {
let data = superagent.get(`${this.url}/quickonline/check`)
if(!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
return (await data).body
}
/**
* fetch all the data from the database
* @param
* @example dbo.all()
*/
async all() {
let data = superagent.get(`${this.url}/quickonline/all`)
if(!data) throw new Error('Invaild URL\n need help? http://discord.gg/devs ')
return data;
}
}
module.exports = bot
class host {
constructor(data) {
if(!data) return;
if(!data) data = 8080
this.port = data
// ( i don't own this pog to check if package exist or no forked it from afriend )
}
async start() {
function moduleAvailable(name) {
try {
require.resolve(name);
return true;
} catch(e){}
return false;
};
if(!moduleAvailable("quick.db")) throw new Error('Missing quick.db package\n need help? join http://discord.gg/devs\nnpm i quick.db')
if(!moduleAvailable("express")) throw new Error('Missing express package\n need help? join http://discord.gg/devs\nnpm i express')
const express = require('express')
const db = require('quick.db')
const app = new express()
constructor(data) {
if (!data) throw new Error("Missing data array need help? http://discord.gg/devs");
if (!data.port) data.port = 8080
if (!data.username) throw new Error("Missing Username,, need help? join http://discord.gg/devs")
if (!data.password) throw new Error("Missing Password, need help? join http://discord.gg/devs")
this.port = data.port
this.username = data.username
this.password = data.password
}
async start() {
const express = require('express')
const db = require('quick.db')
const app = new express()
app.listen(this.port, () => {
console.log(`[Database] started.`)
})
app.get('/quickonline/set', async(req,res) => {
let Key = req.query.set
let value = req.query.value
if(! value && Key) return res.send(false)
db.set(`${Key}`, value)
let data = {
sucsses: true,
key: Key
}
await res.json(data)
})
app.get('/quickonline/get', async(req,res)=>{
let key = req.query.key
if(!key) return res.send(false)
let data = db.get(key)
await res.json(`${data || null}`)
})
app.get('/quickonline/delete', async(req,res)=>{
let key = req.query.key
if(!key) return res.send(false)
app.listen(this.port, () => {
console.log(`[Database] started.`)
})
db.delete(`${key}`)
return res.send('Deleted..')
})
app.get('/quickonline/all', async(req,res)=>{
let data = db.all()
return res.send(data)
})
app.get('/quickonline/add', async(req,res)=>{
let add = req.query.add
if(!add) return res.send(false)
let value = req.query.value
if(!value) return res.send(false)
app.get('/quickonline/set', async(req, res) => {
let Key = req.query.set
let value = req.query.value
let username = req.query.username
let password = req.query.password
// so when i use ! nothing happens so i had to do this sorry js
if (username === this.username) {} else {
return res.send(`invaild username`)
}
if(isNaN(value)) return res.json("string")
let data = db.get(add)
if(!data) {
db.add(add, value)
return res.json(true)
if (password === this.password) {} else {
return res.send(`invaild password`)
}
if (!value && Key) return res.send(false)
db.set(`${Key}`, value)
let data = {
sucsses: true
, key: Key
}
await res.json(data)
})
app.get('/quickonline/get', async(req, res) => {
let key = req.query.key
if (!key) return res.send(false)
let username = req.query.username
let password = req.query.password
if (username === this.username) {} else {
return res.send(`invaild username`)
}
if (password === this.password) {} else {
return res.send(`invaild password`)
}
let data = db.get(key)
await res.json(`${data || null}`)
})
app.get('/quickonline/delete', async(req, res) => {
let key = req.query.key
let username = req.query.username
let password = req.query.password
if (username === this.username) {} else {
return res.send(`invaild username`)
}
if (password === this.password) {} else {
return res.send(`invaild password`)
}
if (!key) return res.send(false)
db.delete(`${key}`)
return res.send('Deleted..')
})
app.get('/quickonline/all', async(req, res) => {
let data = db.all()
let username = req.query.username
let password = req.query.password
if (username === this.username) {} else {
return res.send(`invaild password`)
}
if (password === this.password) {} else {
return res.send(`invaild password`)
}
return res.send(data)
})
app.get('/quickonline/add', async(req, res) => {
let add = req.query.add
if (!add) return res.send(false)
let value = req.query.value
if (!value) return res.send(false)
if (isNaN(value)) return res.json("string")
let username = req.query.username
let password = req.query.password
if (username === this.username) {} else {
return res.send(`invaild username`)
}
if (password === this.password) {} else {
return res.send(`invaild password`)
}
let data = db.get(add)
if (!data) {
db.add(add, value)
return res.json(true)
}
if (data) {
if (isNaN(data)) return res.json("string")
db.add(add, value)
return res.json(true)
}
})
app.get('/quickonline/subtract', async(req, res) => {
let remove = req.query.remove
if (!remove) return res.send(false)
let value = req.query.value
if (!value) return res.send(false)
if (isNaN(value)) return res.json("string")
let username = req.query.username
let password = req.query.password
if (username === this.username) {} else {
return res.send(`invaild username`)
}
if (password === this.password) {} else {
return res.send(`invaild password`)
}
let data = db.get(remove)
if (!data) {
db.subtract(remove, value)
return res.json(true)
} // ik i could just use } else { but doing this is more fun >:)
if (data) {
if (isNaN(data)) return res.json("string")
db.subtract(remove, value)
return res.json(true)
}
})
app.get('/quickonline/fetch', async(req, res) => {
let key = req.query.key
if (!key) return res.json(false)
let username = req.query.username
let password = req.query.password
if (username === this.username) {} else {
return res.send(`invaild username`)
}
if (password === this.password) {} else {
return res.send(`invaild password`)
}
let data = db.get(key)
let pog = {
key: key
, data: data
}
return await res.json(pog)
})
app.get('/quickonline/check', async(req, res) => {
let username = req.query.username
let password = req.query.password
if (username === this.username) {} else {
return res.send(`invaild username`)
}
if (password === this.password) {} else {
return res.send(`invaild password`)
}
return await res.json("Alive")
})
}
if(data) {
if(isNaN(data)) return res.json("string")
db.add(add , value)
return res.json(true)
}
})
app.get('/quickonline/subtract', async(req,res)=>{
let remove = req.query.remove
if(!remove) return res.send(false)
let value = req.query.value
if(!value) return res.send(false)
if(isNaN(value)) return res.json("string")
let data = db.get(remove)
if(!data) {
db.subtract(remove, value)
return res.json(true)
}// ik i could just use } else { but doing this is more fun >:)
if(data) {
if(isNaN(data)) return res.json("string")
db.subtract(remove, value)
return res.json(true)
}
})
app.get('/quickonline/fetch', async(req,res)=> {
let key = req.query.key
if(!key) return res.json(false)
let data = db.get(key)
let pog = {
key: key,
data: data
}
return await res.json(pog)
})
app.get('/quickonline/check', async (req,res)=>{
return await res.json("Alive")
})
}
}
module.exports = host;
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