1.1.1 • Published 2 years ago

wyr v1.1.1

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

wyr

A simple (literally 1 file) package to get would-your-rather questions, easy to use and small

Install

npm i wyr
  • Typescript and Javascript compatible

Usage

Typescript
import wyr from 'wyr';

// wyr is a function and returns a promise with a object containing your questions
wyr().then((response) => {  // or .then(console.log) hehe
console.log(response)
})
Javascript
const wyr = require('wyr').default


// wyr is a function and returns a promise with a object containing your questions
wyr().then((response) => {  // or .then(console.log) hehe
console.log(response)
})

A example of returned response

{
  blue: {
    question: 'Drive 200 miles well over the legal drunken limit',      
    votes: '620,500'
  },
  red: {
    question: 'Drive 200 miles after being awake for 72 hours straight',
    votes: '970,048'
  }
}

ex: To access the blue question: .blue.question, and the count of blue .blue.votes

  • and for red vice versa

Support

as this is a small and simple package i don't expect any one to need any support with it, but if you need me i am always in my discord server ; )

Invite

License

  • This repository and the code inside it is licensed under the MIT License. Read LICENSE for more information.

Other

My github

Discord-Invite