Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

randomquote-api

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

randomquote-api

An api that gets random quotes.

  • 3.5.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

What is this?

randomquote-api is a light weight npm module that gets you random quotes from a collection of quotes!

installation

npm i randomquote-api or yarn add randomquote-api

How to use :

const Quotes = require("randomquote-api");

// To get one random Quote you do

const randomquote = Quotes.randomQuote();
console.log(randomquote);

// to get Ten random quotes you do

const randomTen = Quotes.randomTen();
console.log(randomTen);

// to get a number amount of quotes by who said them

const getbyauthor = Quotes.getbyauthor("J.R.R. Tolkien", 10);
console.log(getbyauthor);

Stuck on [object Object] ?

try mapping it!

const Quotes = require("randomquote-api");
const randomTen = Quotes.randomTen();

console.log(randomTen.map((q) => q.quote).join("\n"));

this also works the same for the getbyauthor() function.

Options

For the quotes itself you can use

  • quote : Get the quote.
  • author : Get who wrote/said the quote.
  • id : Get the number of the quote.

Options for the "getbyauthor(name, n)" function

  • name : the name of the person who wrote the quote.
  • n : the number of quotes you want.

Pull requests

Pull requests are open to anybody willing to contribute.

Need any help?

Join my discord server, and go to the general support channel! https://discord.gg/MACqYvy7cX Or you can contact me on discord TakenKills#8990

Keywords

FAQs

Package last updated on 08 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc