0.2.2 • Published 2 years ago

@brecert/trivia v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Trivia

@brecert/trivia deno module

This package contains a typed fetch builder and some utils for working with the OpenTDB api.

Usage

You can find more info in the documentation.

import {
  Encoding,
  triviaFetch,
  decodeQuestion,
} from "https://deno.land/x/trivia_deno/trivia.ts";

const questions = await triviaFetch({
  amount: 5,
  encode: Encoding.Base64,
  token: undefined,
})
  .then((res) => res.json())
  .then((res) => res.results.map((res) => decodeQuestion(res, atob)));