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

nonimageapi

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nonimageapi - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

src/index.ts

9

examples/test.js
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();
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

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