0.0.5 • Published 3 years ago
waifu.pics.js v0.0.5
Waifu.pics.js
A powerful waifu.pics api wrapper for NodeJS.
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: [ .... ] }
})();