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

@broken_bones/randomquotes

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@broken_bones/randomquotes

This is a simple Node.js module to retrieve random quotes from the Type Fit Quotes API. It utilizes the Axios library to make an HTTP GET request to the API and returns an array of quotes.

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Daily Trivia Questions API

This is a simple Node.js module to retrieve random quotes from the Type Fit Quotes API. It utilizes the Axios library to make an HTTP GET request to the API and returns an array of quotes.

Installation

To use this module, first install it using npm:

npm i @broken_bones/randomquotes

Usage

To use this module in your Node.js project, require it and call the getDailyQuestions function:

const randomQuotes = require('@broken_bones/randomquotes');

// Get a single random quote
randomQuotes.getRandomQuotes().then(quotes => {
  console.log(quotes[0]);
});

// Get 5 random quotes
randomQuotes.getRandomQuotes(5).then(quotes => {
  console.log(quotes);
});

// Get 5 random quotes by Albert Einstein
randomQuotes.getRandomQuotes(5, 'Albert Einstein').then(quotes => {
  console.log(quotes);
});

The getRandomQuotes function accepts the following optional parameters:

numQuotes: The number of quotes to retrieve. Defaults to 1 if not specified. author: The author of the quotes to retrieve. keyword: This parameter is no longer available. This function returns a Promise that resolves to an array of quote objects, where each object has the following properties:

text: The text of the quote. author: The author of the quote (if available). source: The source of the quote (if available).

License

This project is licensed under the MIT License - see the LICENSE file for details.

FAQs

Package last updated on 07 Apr 2023

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