Skip to content

v1.1.3

Latest
Compare
Choose a tag to compare
@mian-ali mian-ali released this 02 Jul 17:30
effa73a

v1.1.3 - 2024-07-02

New Features

  • Category Quotes: Added support for fetching quotes by category. Now you can get quotes specific to categories such as programming, life, education, etc.
  • Author Option: Introduced the author option for quotes. You can now choose whether to include the author's name in the quote.

Improvements

  • Documentation: Enhanced the README with detailed instructions and examples on how to use the package. Added a comprehensive guide for contributors.
  • Tests: Improved test coverage for new features. Added unit tests for getQuote(), getRandomQuote(), and getDailyQuote() functions.

Bug Fixes

  • Error Handling: Fixed issues with error messages for invalid categories.
  • Random Quotes: Addressed a bug where random quotes sometimes failed to fetch correctly.

Documentation

  • Updated README with installation instructions, usage examples, and detailed API documentation.

Miscellaneous

  • Versioning: Bumped version to 1.1.3 to include new features and improvements.
  • Package Management: Added more robust package management and dependency updates.

Installation

To install the latest version, use the following command:

npm install motivate-quotes@1.1.3
import { getQuotes, getRandomQuote, getDayOfQuote } from 'motivate-quotes';

// Fetch quotes from a specific category
try {
  const quotes = getQuotes({
    author: false,
    numberOfQuotes: 2,
    category: 'Programming',
  });
  console.log(quotes);
} catch (error) {
  console.error(error.message);
}

// Fetch a random quote from a specific category
const randomQuote = getRandomQuote('Education');
console.log(randomQuote);

// Fetch the quote of the day
const dayOfQuote = getDayOfQuote();
console.log(dayOfQuote);

New Contributors