Skip to content

Motivate Quotes is an NPM package that provides inspiring and motivational quotes from various categories such as Programming, Education, Trading, Business, Life, Fitness, Creativity, and Leadership.

License

Notifications You must be signed in to change notification settings

mian-ali/motivate-quotes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Motivate Quotes

NPM Version GitHub license Snyk Vulnerabilities for npm package version PRs Welcome

Motivate Quotes is an NPM package that provides inspiring and motivational quotes from various categories such as Programming, Education, Trading, Business, Life, Fitness, Creativity, and Leadership.

Click here to view this package on the NPM registry.

Getting Started

NPM

Installation

To use this package, install it via npm:

$ npm install motivate-quotes

Usage

Import the functions from the motivate-quotes package and use them as demonstrated below:

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);

Functions

getQuotes(options)

Fetches quotes based on the specified options.

Name Type Description
category string The category of quotes. Required. Available categories: Programming, Education, Trading, Business, Life, Fitness, Creativity, Leadership.
author boolean Whether to include the author's name. Optional. Default is true.
numberOfQuotes number The number of quotes to return. Optional. Default is 1.

Returns an array of quotes based on the specified options.

Example:

[
  {
    "text": "First, solve the problem. Then, write the code.",
    "author": "John Johnson"
  },
  {
    "text": "Experience is the name everyone gives to their mistakes.",
    "author": "Oscar Wilde"
  }
]

getRandomQuote(category)

Fetches a random quote from the specified category.

Name Type Description
category string The category of quotes. Required. Available categories: Programming, Education, Trading, Business, Life, Fitness, Creativity, Leadership.

Returns an array of quotes based on the specified options.

Example:

{
  "text": "Education is the most powerful weapon which you can use to change the world.",
  "author": "Nelson Mandela"
}

getDayOfQuote()

Fetches the quote of the day.

Returns the quote of the day.

Example:

{
  "text": "The only way to do great work is to love what you do.",
  "author": "Steve Jobs"
}

Examples

To view the examples, clone the motivate-quotes repo and install the dependencies:

$ git clone https://github.com/mian-ali/motivate-quotes.git
$ cd motivate-quotes
$ npm install

Then run the examples/index.js:

$ node index.js

Tests

  • npm run test: Runs unit tests
  • npm run format: Run eslint format

Contributors

Contributors are individuals who have made significant contributions to a project. They play a crucial role in the development and success of open-source projects by contributing code, documentation, bug fixes, and other valuable contributions.

If you would like to become a contributor to this project, please follow these steps:

  1. Fork the project repository.
  2. Make the necessary changes or additions to the codebase.
  3. Test your changes thoroughly to ensure they do not introduce any issues.
  4. Submit a pull request to the original repository, detailing your changes and why they are beneficial.

Note: So that you know, all contributions are subject to review and approval by the project maintainers. Your contributions should align with the project's guidelines and coding standards.

Thank you for considering becoming a contributor to this project. Your contributions are greatly appreciated!

Author

Ali Ahmad

About

Motivate Quotes is an NPM package that provides inspiring and motivational quotes from various categories such as Programming, Education, Trading, Business, Life, Fitness, Creativity, and Leadership.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published