Coder Social home page Coder Social logo

anhdungadg / inspirational-quotes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinitshahdeo/inspirational-quotes

0.0 0.0 0.0 130 KB

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

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

License: MIT License

JavaScript 100.00%

inspirational-quotes's Introduction

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
  • getQuote() method returns an object containing text and author.
 {  
    "text":"My number one piece of advice is: you should learn how to program.",
    "author":"Mark Zuckerberg, founder of Facebook"
 }
  • getRandomQuote() method returns a random inspirational quote : You miss 100 percent of the shots you don’t take.

Options

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

getQuote({ author: false });
  • { author: true }: Returns a quote with author information
  • { author: false }: Returns a quote without author information

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

  • npm run test: Runs unit tests
  • npm run test-lint: Run lint 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:

  • Clone the repository and create a new branch
git clone https://github.com/vinitshahdeo/inspirational-quotes.git
git checkout feature/new-quote
cd data
vi data.json
  • Add a quote at random index (just to avoid conflicts if every PR appends a quote at the last)
 {  
    "text":"Your Awesome Quote",
    "from":"Name of author"
 }
  • Run tests locally
npm run test-lint
npm run test
  • Tests passed successfully?

    • If yes, please raise a pull request to add the quote
    • Otherwise, fix the tests and run the tests again
  • Sit and relax! You've made your contribution. πŸŽ‰

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.

Stargazer ❀️

Stargazers repo roster for @vinitshahdeo/inspirational-quotes

Related Works

  • Checkout Quotter - A twitter bot which tweets random quotes with image and #hashtags!

  • Click here to view applications created by open-source community using this module.

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!

  • You can find my other NPM Packages here.
  • Find my blog here.

"Buy Me A Coffee"


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

inspirational-quotes's People

Contributors

vinitshahdeo avatar cedarctic 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.