anime-quotes-sdk
v2.6.0
Published
A Node.js SDK to fetch a random quote from a pre-fetched list of quotes.
Downloads
27
Readme
Introduction
Animekun is a tiny sdk to get random anime quotes
Its absolutely free to use.
If you find this sdk helpful, please consider leaving a rating. 😎👍🏻
If you have any questions, suggestions, or anything else, don't hesitate to reach out to me! 🧑💻
Getting Started
Get a random quote.
const animeQuotes = require('anime-quotes-sdk');
const quotes = new animeQuotes();
quotes
.fetchQuotes()
.then(() => {
quotes
.getRandomQuote()
.then((quote) => {
console.log("Random Quote:", quote);
})
.catch((err) => console.error("Failed to get random quote:", err));
})
.catch((err) => console.error("Failed to fetch quotes:", err));
Get a random quote by anime title.
const animeQuotes = require('anime-quotes-sdk');
const quotes = new animeQuotes();
quotes
.fetchQuotes()
.then(() => {
quotes
.getRandomQuoteByAnime("naruto")
.then((quote) => {
console.log("Random Quote from Naruto:", quote);
})
.catch((err) =>
console.error("Failed to get random quote from Naruto:", err)
);
})
.catch((err) => console.error("Failed to fetch quotes:", err));
Get upto 10 random quotes.
const animeQuotes = require('anime-quotes-sdk');
const quotes = new animeQuotes();
quotes
.fetchQuotes()
.then(() => {
quotes
.getRandomQuotes(10)
.then((quotes) => {
console.log("Random 10 Quotes:", quotes);
})
.catch((err) => console.error("Failed to get random 10 quotes:", err));
})
.catch((err) => console.error("Failed to fetch quotes:", err));
Get upto 10 random quotes by anime name
const animeQuotes = require('anime-quotes-sdk');
const quotes = new animeQuotes();
quotes
.fetchQuotes()
.then(() => {
quotes
.getQuotesByAnime("naruto", 10)
.then((quotes) => {
console.log("10 Quotes from Naruto:", quotes);
})
.catch((err) =>
console.error("Failed to get 10 quotes from Naruto:", err)
);
})
.catch((err) => console.error("Failed to fetch quotes:", err));