Skip to content

Crysthamus/Quotely

Repository files navigation

Quotely

A simple and easy to use typescript quotes package that provides you with over 120 thousand different quotes from various authors ranked by popularity and divided into 30 different categories stats file.
MIT License

Installation

Quotely can be installed via npm

npm install quotely

Usage/Examples

The following code returns a quote object with value between 10-200 characters long by C.S. Lewis.

import { getRandomQuote } from "./functions";

getRandomQuote({
  minLength: 10,
  maxLength: 200,
  author: "C.S. Lewis",
  categories: ["Friendship", "Relationship"],
}),

Like So:

{
  Quote: 'Friendship ... is born at the moment when one man says to another "What! You too? I thought that no one but myself . . .',
  Author: 'C.S. Lewis,  The Four Loves',
  Categories: [ 'Friendship', 'Relationship' ],
}

All the parameters are optional and running:

getRandomQuote({})

returns a random quote object from the json file.

About

A simple and free to use npm package that provides you with random quotes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •