Socket
Socket
Sign inDemoInstall

randomquote-api

Package Overview
Dependencies
0
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    randomquote-api

An api that gets random quotes.


Version published
Maintainers
1
Created

Readme

Source

What is this?

This is a npm package that gets random quots!

installation

npm i randomquote-api

How to use :

const RandomQuoteApi = require('randomquote-api')
// To get one random Quote you do
const randomquoteapi = new RandomQuoteApi()
const randomquote = randomquoteapi.randomQuote()
console.log(randomquote)

// to get Ten random quotes you do
const randomTen = randomquoteapi.randomTen()
console.log(randomTen)

// to get a number amount of quotes by who said them
const randomQuote = new RandomQuoteApi()
const getbyauthor = randomQuote.getbyauthor('J.R.R. Tolkien', 10)
console.log(getbyauthor)

Stuck on [object Object] ?

try mapping it!

const randomquoteapi = new RandomQuoteApi()
const randomTen = randomquoteapi.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.
  • by : 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.

Need any help?

Join my discord server! https://discord.gg/Q34NvFVmwW

Keywords

FAQs

Last updated on 02 Jan 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc