-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexamples.js
42 lines (26 loc) · 1.7 KB
/
examples.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const neko = require("nekolife.js");
let nekoclient = new Neko.Client(); // default api key is defaulted :D
// Asynchronous(Async/await) examples.
let hug = await nekoclient.hug();
console.log(hug.url); // logs to console the url for hug gif
let pat = await nekoclient.pat();
console.log(pat.url); // logs to console the url for pat gif
let kiss = await nekoclient.kiss();
console.log(kiss.url); // logs to console the url for kiss gif
let neko = await nekoclient.neko();
console.log(neko.neko); // logs to console the url for Neko picture
let why = await nekoclient.why();
console.log(why.why); // logs to console a funny why joke
let LewdNeko = await nekoclient.LewdNeko();
console.log(LewdNeko.neko); // logs to console a LewdNeko image url
let lizard = await nekoclient.lizard();
console.log(lizard.url); // logs to console a lizard image url
// ES6 promises examples.
nekoclient.hug().then((hug) => console.log(hug.url)); // logs to console the url for hug gif
nekoclient.pat().then((pat) => console.log(pat.url)); // logs to console the url for pat gif
nekoclient.kiss().then((kiss) => console.log(kiss.url)); // logs to console the url for kiss gif
nekoclient.neko().then((neko) => console.log(neko.neko)); // logs to console the url for a Neko picture
nekoclient.why().then((why) => console.log(why.why)); // logs to console a funny why joke
nekoclient.LewdNeko().then((LewdNeko) => console.log(LewdNeko.neko)); // logs to console a LewdNeko image url
nekoclient.lizard().then((lizard) => console.log(lizard.url)); // logs to console a lizard image url
// The end.