brecert / trivia-deno

simple deno module and cli to interact with OpenTDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)));

About

simple deno module and cli to interact with OpenTDB


Languages

Language:TypeScript 89.7%Language:Nix 10.3%