2.0.1 • Published 8 months ago

quote-lib v2.0.1

Weekly downloads
10
License
MIT
Repository
github
Last release
8 months ago

Quote Lib

A simple library for generating quotes.

Installation

npm install quote-lib

Usage

Random Quote

import { getRandomQuote } from "quote-lib";
console.log(getRandomQuote());

Output

{
  id: 5,
  text: "If you can't explain it simply, you don't understand it well enough.",
  author: 'Albert Einstein',
  category: [ 'motivational', 'education' ]
}

Get Quote by ID

import { getQuoteById } from "quote-lib";
console.log(getQuoteById(5));

Output

{
  id: 5,
  text: "If you can't explain it simply, you don't understand it well enough.",
  author: 'Albert Einstein',
  category: [ 'motivational', 'education' ]
}

Get Quote by Category

import { getQuoteByCategory } from "quote-lib";
console.log(getQuoteByCategory("motivational"));

Output

 {
    id: 1,
    text: "If you can't explain it simply, you don't understand it well enough.",
    author: 'Albert Einstein',
    category: [ 'motivational', 'education' ]
  }

Get Quotes by Author

import { getQuotesByAuthor } from "quote-lib";
console.log(getQuotesByAuthor("Chris Grosser"));

Output

[
  {
    id: 3,
    text: "Opportunities don't happen, you create them.",
    author: 'Chris Grosser',
    category: [ 'motivational', 'entrepreneur' ]
  }
]

Get Quote by Author

import { getQuoteByAuthor } from "quote-lib";
console.log(getQuotesByAuthor("Chris Grosser"));

Output

  {
    id: 3,
    text: "Opportunities don't happen, you create them.",
    author: 'Chris Grosser',
    category: [ 'motivational', 'entrepreneur' ]
  }

License

MIT © Pasindu P Konghawaththa

Contributing

please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

2.0.0-beta.1

8 months ago

2.0.0-beta.0

8 months ago

2.0.1

8 months ago

2.0.0-beta.4

8 months ago

2.0.0

8 months ago

2.0.0-beta.3

8 months ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago