inspirational-quotes

A simple NPM Package which returns random Inspirational Quotes. Get your daily quote and stay motivated!

View the Project on GitHub

Inspirational Quotes

NPM VERSION GitHub license npm collaborators Snyk Vulnerabilities for npm package version npm PRs Welcome

A simple NPM Package which returns random Inspirational Quotes. It provides awesome quotes to display in your application. Get your daily quote and stay motivated!

Click here to view this package on NPM registry. Check the homepage here.

Getting started

NPM

$ npm install --save inspirational-quotes

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

Installation is done using the npm install command:

$ npm install inspirational-quotes

Usage


const Quote = require('inspirational-quotes');

console.log(Quote.getQuote()); // returns quote (text and author)
console.log(Quote.getQuote({ author: false }); // return quote without author
console.log(Quote.getRandomQuote()); // return any random quote

 {  
    "text":"My number one piece of advice is: you should learn how to program.",
    "author":"Mark Zuckerberg, founder of Facebook"
 }

Options

Additionally you can provide options to getQuote method. By default { author: true } is used.


getQuote({ author: false });

Note: Recommended to use getQuote with { author: false} option instead of getRandomQuote as it will be deprecated in the further versions. It’s available just to ensure the backward compatability.

Examples

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

$ git clone https://github.com/vinitshahdeo/inspirational-quotes.git
$ cd inspirational-quotes
$ npm install

Then run the examples/index.js:

$ node examples

Tests

Contributing

Do you know any inspirational quotes so one can start working by taking control over thoughts, thinking positively and setting new goals? Append your quote to data.json inside the data/ directory and raise the PR.

Please check [ISSUE #4] : Add More Inspirational Quotes (Recommended for beginners)

Steps to follow:

git clone https://github.com/vinitshahdeo/inspirational-quotes.git
git checkout feature/new-quote
cd data
vi data.json
 {  
    "text":"Your new awesom quote",
    "from":"Name of author"
 }
npm run test-lint
npm run test

Disclaimer: There’re so many open pull requests. It’s not possible for me to merge them all manually. I will write an automation script if that’s possible. If you’ve an idea, please feel free to share it on discussions. Happy to take it forward from there.

I’ll be more than happy to know if you build something using this module. Tweet your work at @Vinit_Shahdeo

Twitter Follow

Author

Vinit Shahdeo

Support

Open Source Love GitHub followers

Thank you for being here! One day your life will flash before your eyes. Make sure it is worth watching!

"Buy Me A Coffee"


   _____ _                _____                 _              _ 
  / ____| |              |_   _|               (_)            | |
 | (___ | |_ __ _ _   _    | |  _ __  ___ _ __  _ _ __ ___  __| |
  \___ \| __/ _` | | | |   | | | '_ \/ __| '_ \| | '__/ _ \/ _` |
  ____) | || (_| | |_| |  _| |_| | | \__ \ |_) | | | |  __/ (_| |
 |_____/ \__\__,_|\__, | |_____|_| |_|___/ .__/|_|_|  \___|\__,_|
                   __/ |                 | |                     
                  |___/                  |_|