npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

inspirational-quotes

v2.0.1

Published

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

Downloads

2,924

Readme

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 new awesom 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. :tada:

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.

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"


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