0.0.5 • Published 3 years ago

waifu.pics.js v0.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

waifu.pics

Waifu.pics.js

A powerful waifu.pics api wrapper for NodeJS. Latest Stable Version NPM Downloads NPM Downloads npm bundle size GitHub repo size node-current

Install

npm install waifu.pics.js

API

core

A functions that loaded from require("waifu.pics.js"), Fetching many waifu url from waifu.pics endpoint. Returns Promise { <pending> }

const waifu = require("waifu.pics.js");

waifu().then(json => {
	/*
		{
			files: [
				'https://i.waifu.pics/uc-SymC.jpg',
				....
			]
		}
	*/
}).catch(console.error);

// Or
(async () => {
	var response = await waifu();
	// { files: [ .... ] }
})();

core.<type>

A function that fetch a requested waifu type, Waifu has 2 types, They are sfw and nsfw Returns Promise { <pending> }

waifu.sfw("neko").then(json => {
	// { url: 'https://i.waifu.pics/vwNedaS.jpg' }	
}).catch(console.error);

// Or
(async () => {
	var response = await waifu.sfw("neko")();
	// { url: '....' }
})();

core.<type>.categories

A object property that returns all <waifu type> categories key, Returns object

console.log( waifu.sfw.categories );
/*
	[
 	  'waifu',    'neko',     'shinobu',
	  'megumin',  'bully',    'cuddle',
	  'cry',      'hug',      'awoo',
	  'kiss',     'lick',     'pat',
	  'smug',     'bonk',     'yeet',
	  'blush',    'smile',    'wave',
	  'highfive', 'handhold', 'nom',
	  'bite',     'glomp',    'kill',
	  'slap',     'happy',    'wink',
	  'poke',     'dance',    'cringe'
	]
*/

core.<type>.many

Same as core.<type> does, but returns many url from requested categories. Returns Promise { <pending> }

waifu.sfw.many("smile").then(json => {                                                                                       /*
                {
                        files: [                                                                                                     'https://i.waifu.pics/uc-SymC.jpg',
                                ....
                        ]
                }
        */
}).catch(console.error);

// Or
(async () => {
	var response = await waifu.sfw.many("smile");
	// { files: [ .... ] }
})();

Community

Useful Link

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago