Socket
Socket
Sign inDemoInstall

croxy-api

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

croxy-api - npm Package Compare versions

Comparing version 2.0.9 to 2.1.0

79

files/app.js
const request = require('node-superfetch');
const deasync = require("deasync");

@@ -39,4 +38,3 @@ class CroxyApi {

*/
döviz() {
return deasync(async (cb) => {
async döviz() {
try {

@@ -54,3 +52,3 @@ const { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/doviz?key=${this.key}`);

});
cb(null, veriler);
return veriler;
} catch (err) {

@@ -60,3 +58,2 @@

}
})();
}

@@ -71,4 +68,3 @@

*/
kripto() {
return deasync(async (cb) => {
async kripto() {
try {

@@ -86,3 +82,3 @@ const { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/kripto?key=${this.key}`);

});
cb(null, veriler);
return veriler;
} catch (err) {

@@ -92,3 +88,2 @@

}
})();
}

@@ -103,4 +98,3 @@

*/
hisse() {
return deasync(async (cb) => {
async hisse() {
try {

@@ -120,3 +114,3 @@ const { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/hisse?key=${this.key}`);

});
cb(null, veriler);
return veriler;
} catch (err) {

@@ -126,3 +120,2 @@

}
})();
}

@@ -138,8 +131,7 @@

*/
deprem(sayi) {
async deprem(sayi) {
if(!sayi || !Number(sayi) || sayi < 1) throw new TypeError('Lütfen kaç tane depremin görüntüleceğini yazın.')
return deasync(async (cb) => {
try {
const { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/deprem?key=${this.key}&sayi=${sayi}`);
cb(null, body)
return body;
} catch (err) {

@@ -149,3 +141,2 @@

}
})();
}

@@ -161,8 +152,7 @@

*/
steam(isim) {
async steam(isim) {
if(!isim) throw new TypeError('Lütfen bir oyun ismi girin.')
return deasync(async (cb) => {
try {
const { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/steam?key=${this.key}&ara=${isim}`);
cb(null, body)
return body
} catch (err) {

@@ -172,3 +162,2 @@

}
})();
}

@@ -184,8 +173,7 @@

*/
minecraftSunucu(ip) {
async minecraftSunucu(ip) {
if(!ip) throw new TypeError('Lütfen bir sunucu IP\'si girin.')
return deasync(async (cb) => {
try {
const { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/minecraftSunucu?key=${this.key}&ara=${ip}`);
cb(null, body)
return body
} catch (err) {

@@ -195,3 +183,2 @@

}
})();
}

@@ -207,8 +194,7 @@

*/
wikipedia(ara) {
async wikipedia(ara) {
if(!ara) throw new TypeError('Lütfen aratılacak bir şey girin.')
return deasync(async (cb) => {
try {
const { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/wikipedia?key=${this.key}&ara=${ip}`);
cb(null, body)
return body
} catch (err) {

@@ -218,3 +204,2 @@

}
})();
}

@@ -232,10 +217,9 @@

haber(sayi, kategori) {
async haber(sayi, kategori) {
const kategoriler = ["ekonomi", "magazin", "spor", "gündem", "türkiye", "dünya"]
if(!sayi) throw new TypeError("Kaç tane haberin görüntüleneceğini yazın.")
if(!kategoriler.includes(kategori)) throw new TypeError("Şu kategorileri girebilirsin: "+kategoriler.join(", "))
return deasync(async (cb) => {
try {
var { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/haber?key=${this.key}&sayi=${sayi}&kategori=${kategori}`);
cb(null, body.hata ? body.hata : Object.keys(body.sonuç).map(x => body.sonuç[x]));
return body.hata ? body.hata : Object.keys(body.sonuç).map(x => body.sonuç[x]);
} catch (err) {

@@ -245,3 +229,2 @@

}
})();
}

@@ -257,5 +240,4 @@

*/
youtubeVideolar(kanal) {
async youtubeVideolar(kanal) {
if(!kanal) throw new TypeError('Lütfen bir kanal ID\'si girin.')
return deasync(async (cb) => {
try {

@@ -267,4 +249,3 @@ var { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/youtubeVideo?key=${this.key}&kanal=${kanal}`);

}
cb(null, body.hata ? body.hata : body);
})()
return body.hata ? body.hata : body;
}

@@ -281,6 +262,5 @@

*/
çeviri(dil, mesaj) {
async çeviri(dil, mesaj) {
if(!dil) throw new TypeError('Lütfen bir dil girin. (örn: en)')
if(!mesaj) throw new TypeError('Lütfen bir mesaj girin.')
return deasync(async (cb) => {
try {

@@ -292,4 +272,3 @@ var { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/ceviri?key=${this.key}&dil=${dil}&mesaj=${mesaj}`);

}
cb(null, body.hata ? body.hata : body);
})()
return body.hata ? body.hata : body;
}

@@ -305,5 +284,4 @@

*/
namazVakitleri(şehir) {
async namazVakitleri(şehir) {
if(!şehir) throw new TypeError('Lütfen bir şehir ismi girin.')
return deasync(async (cb) => {
try {

@@ -315,4 +293,3 @@ var { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/namazVakitleri?key=${this.key}&sehir=${şehir}`);

}
cb(null, body.hata ? body.hata : body);
})()
return body.hata ? body.hata : body;
}

@@ -328,5 +305,4 @@

*/
havaDurumu(şehir) {
async havaDurumu(şehir) {
if(!şehir) throw new TypeError('Lütfen bir şehir ismi girin.')
return deasync(async (cb) => {
try {

@@ -338,4 +314,3 @@ var { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/havaDurumu?key=${this.key}&il=${şehir}`);

}
cb(null, body.hata ? body.hata : body);
})()
return body.hata ? body.hata : body;
}

@@ -352,9 +327,8 @@

*/
kaçkm(şehir1, şehir2) {
async kaçkm(şehir1, şehir2) {
if(!şehir1) throw new TypeError('Lütfen bir şehir girin.')
if(!şehir2) throw new TypeError('Lütfen bir şehir girin.')
return deasync(async (cb) => {
try {
var { body } = await request.get(`https://croxythedeveloper.com.tr/api/croxyapi/kackm?key=${this.key}&sehir1=${şehir1}&sehir2=${şehir2}`);
cb(null, body.hata ? body.hata : body);
return body.hata ? body.hata : body;
} catch (err) {

@@ -364,3 +338,2 @@

}
})()
}

@@ -367,0 +340,0 @@

{
"bundleDependencies": false,
"dependencies": {
"node-superfetch": "^0.1.10",
"deasync": "^0.1.20"
"node-superfetch": "^0.1.10"
},

@@ -63,3 +62,3 @@ "deprecated": false,

},
"version": "2.0.9"
"version": "2.1.0"
}

@@ -7,3 +7,3 @@ # CroxyAPI - Gelişmiş Bir Türkçe Modül!

# Yenilikler
- "api.çeviri()", "api.namazVakitleri()", "api.havaDurumu()", "api.hisse()" ve "api.wikipedia()" fonksiyonları eklendi.
- Bütün fonksiyonlar Async hale getirildi.

@@ -14,5 +14,6 @@ # Örnek;

const croxy = require("croxy-api");
const api = croxy = new croxy("API-KEY")
const api = new croxy("API-KEY")
api.youtubeVideolar("newdaynewgame")
const veri = await api.youtubeVideolar("newdaynewgame")
console.log(veri)
//sonuç:

@@ -19,0 +20,0 @@

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