Giter Site home page Giter Site logo

sappquestions's Introduction

sappQuestions

sappQuestions is a very lightweight npm package that provides a collection of questions with various categories. It allows you to retrieve random questions or questions from specific categories. All questions were manually curated, ensuring no duplicates, no API reliance, and no downtime.

Installation

You can install sappQuestions using npm:

npm install sappquestions@latest

Usage

Here's an example how to use sappQuestions:

/* JavaScript */ const { Language, getRandomQuestion, fetchCategories, fetchQuestions } = require("sappquestions")
/* TypeScrippt */ import { Language, getRandomQuestion, fetchCategories, fetchQuestions } from "sappquestions"

// Fetch and display a random quote
await getRandomQuestion().then((question) => {
    console.log(`"${question.question}" - ${question.category}`);
  });

// Fetch and display a random quote from a specific category
const category = "coding";
await getRandomQuestion(category).then((question) => {
  console.log(`"${question.question}" - ${question.category}`);
});

// Fetch and display available categories
await fetchCategories().then((categories) => {
  console.log("Available categories:", categories);
});

// Fetch and display available questions
await fetchQuestions(Language["en-US"]).then((questions) => {
  console.log("Available questions:", questions);
});

API

The sappQuestions package provides the following functions:

getRandomQuestion(category?: string, language: Language)

Retrieve a random question from a specific category.

  • category?: The category from which to retrieve the question.
  • language: The language from which to retrieve the question.

fetchCategories

Retrieve all available questions.

fetchQuestions(Language)

Retrieve all available questions.

  • language: The language from which to retrieve the question.

Languages

All available languages

  • Arabic, Egypt (العربية، مصر)
  • Bulgarian (български)
  • ChineseCN (简体中文)
  • ChineseTW (繁體中文)
  • Croatian (Hrvatski)
  • Czech (čeština)
  • Danish (Dansk)
  • Dutch (Nederlands)
  • English (United Kingdom)
  • English (United States)
  • Finnish (Suomi)
  • French (Français)
  • German (Deutsch)
  • Greek (Ελληνικά)
  • Hindi (हिन्दी)
  • Hungarian (Magyar)
  • Indonesian (Bahasa Indonesia)
  • Italian (Italiano)
  • Japanese (日本語)
  • Korean (한국어)
  • Lithuanian (Lietuvių)
  • Norwegian (Norsk)
  • Polish (Polski)
  • PortugueseBR (Português)
  • Romanian (Română)
  • Russian (Русский)
  • SpanishES (Español)
  • Swedish (Svenska)
  • Thai (ไทย)
  • Turkish (Türkçe)
  • Ukrainian (Українська)
  • Vietnamese (Tiếng Việt)

License

License

sappquestions's People

Contributors

duckodas avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.