3.0.3 • Published 1 year ago

@leoua/fumo-api v3.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

This is a fork of the fumo api, but better.

Added

  • A client class where all functions are passed
  • Cache systems

Install with npm install @leoua/fumo-api or yarn add @leoua/fumo-api

Example Usage (no cache)

const client = new FumoClient({ cache: false });

(async () => {
    const fumo = await client.fetchRandomFumo();

    console.log(fumo);
})();

Working With Cache

const client = new FumoClient({
    cache: true // Optional, default is set to true
});

// Wait a bit for the fumos to get cached
setTimeout(function () {
    console.log(`Random fumo: ${client.cache.random().URL}`);
}, 2500);

Working With Custom Cache

const myFumos = [
    {
        URL: 'https://tenor.com/view/yuyuko-yuyuko-saigyouji-touhou-fumo-touhou-fumo-gif-25089428',
        _id: 'yuyuko_dead',
        __v: 0,
    },
];

const client = new FumoClient({
    cache: true, // Optional, default is set to true
    customCache: myFumos,
});

console.log(client.cache.random()._id); // yuyuko_dead
3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.8

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.5

2 years ago