@blumqa/astronomy
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@blumqa/astronomy

What is it?

It's' a package to use dynamic q&a (questions and answers) of astronomy

How to install

pnpm install @blumqa/astronomy

You can use any package manager you want, as long as blumqa is added.

How to use

/**
 * @param lang Options are 'en' and 'es'
 * @param id The id of the q&a
*/
getRandom(lang: string) // Output: {id: number, question: string, answer: string, options: string[]}
getById(lang: string, id: number) // Output: {id: number, question: string, answer: string, options: string[]}

Example

const { getRandom, getById } = require('@blumqa/astronomy')

console.log(getRandom('en')) // Output: {id: number, question: string, answer: string, options: string[]}
console.log(getById('es', 5)) // Output: {id: 5, question: "¿Quién fue el primer cosmonauta en viajar al espacio?", answer: "Yuri Gagarin", options: ["Neil Armstrong", "Buzz Aldrin", "Yuri Gagarin", "Alan Shepard"]}

Package Sidebar

Install

npm i @blumqa/astronomy

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

132 kB

Total Files

13

Last publish

Collaborators

  • andrewdotdev