nonimageapi
Advanced tools
Comparing version 1.0.2 to 1.0.3
const nonimageapi = require("../index.js"); | ||
const images = new nonimageapi(); | ||
let test = images.fakemsg("bomdia", "nome-legal", null, true); | ||
console.log(test); | ||
let json = images.memes(true); | ||
console.log(json); | ||
async function test() { | ||
let img = await images.memes() | ||
console.log(img.url) | ||
}; | ||
test(); |
27
index.js
const fetch = require('node-fetch'); | ||
let url = "https://nonimageapi.apenasigor.repl.co/api/v1/"; | ||
const superagent = require('superagent'); | ||
class Image { | ||
constructor(Image) { | ||
constructor() { | ||
this.ImageApi = Image; | ||
} | ||
@@ -16,17 +17,11 @@ fakemsg(msg, username, avatar, bot) { | ||
} | ||
async memes(json) { | ||
if(json) { | ||
fetch(url + `memes?json=true`).then(res => res.json()).then(data => { | ||
return data.post; | ||
}); | ||
} else return url + `memes`; | ||
}; | ||
async cats(json) { | ||
if(json) { | ||
fetch(url + `cats?json=true`).then(res => res.json()).then(data => { | ||
return data.post; | ||
}); | ||
} else return url + `cats`; | ||
}; | ||
async memes() { | ||
const {body} = await superagent.get(url + "memes"); | ||
return body; | ||
} | ||
async cats() { | ||
const {body} = await superagent.get(url + "cats"); | ||
return body; | ||
} | ||
} | ||
module.exports = Image; |
{ | ||
"name": "nonimageapi", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "An image api for you to have fun", | ||
@@ -9,4 +9,6 @@ "main": "index.js", | ||
}, | ||
"repository": "apenasigordev/NonImagePackage", | ||
"scripts": { | ||
"test": "node ./examples/test.js" | ||
"test": "node ./examples/test.js", | ||
"build": "tsc" | ||
}, | ||
@@ -22,3 +24,11 @@ "keywords": [ | ||
"node-fetch": "^2.6.1" | ||
}, | ||
"dependencies": { | ||
"@types/node-fetch": "^2.5.11", | ||
"node-fetch": "^2.6.1", | ||
"superagent": "^6.1.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^4.3.5" | ||
} | ||
} |
@@ -9,8 +9,19 @@ # NonImageApi (Beta) | ||
const images = new NonImageApi(); | ||
async() { | ||
await images.memes() // Set json to true or false (Optional) | ||
await images.cats() // Set json to true or false (Optional) | ||
}(); | ||
async function memes() { | ||
let meme = await images.memes(); | ||
console.log(meme); // Returns json url | ||
} | ||
meme(); | ||
``` | ||
``` | ||
const NonImageApi = require('nonimageapi'); | ||
const images = new NonImageApi(); | ||
async function cats() { | ||
let cat = await images.cats(); | ||
console.log(cat) | ||
} | ||
cats() | ||
``` | ||
----- | ||
@@ -30,4 +41,5 @@ | ||
[M. Experimental](https://github.com/experimentaljs) | ||
[ImmaUGC](https://github.com/ImmaUgc) | ||
[ApenasIgorDev](https://github.com/apenasigordev) |
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
4336
8
75
43
0
3
1
+ Added@types/node-fetch@^2.5.11
+ Addednode-fetch@^2.6.1
+ Addedsuperagent@^6.1.0
+ Added@types/node@22.10.10(transitive)
+ Added@types/node-fetch@2.6.12(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addedcookiejar@2.1.4(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedfast-safe-stringify@2.1.1(transitive)
+ Addedform-data@3.0.24.0.1(transitive)
+ Addedformidable@1.2.6(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@2.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.1.3(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedqs@6.14.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedside-channel@1.1.0(transitive)
+ Addedside-channel-list@1.0.0(transitive)
+ Addedside-channel-map@1.0.1(transitive)
+ Addedside-channel-weakmap@1.0.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedsuperagent@6.1.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)