Giter Site home page Giter Site logo

mian-ali / motivate-quotes Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 72 KB

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.

Home Page: https://www.npmjs.com/package/motivate-quotes

License: MIT License

JavaScript 100.00%
inspiration motivational-quotes npm-module npm-package quote-generator quotes npm-quotes motivate-quotes quote

motivate-quotes's Introduction

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

motivate-quotes's People

Contributors

mian-ali avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.