Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
A nodejs module for getting trivia questions in all your fancy projects, in a pretty simple way.
A Node.JS module for getting trivia questions in all your fancy projects, in a pretty simple way.
Promise.<Object>
Returs the available categories of the trivia questions.
Promise.<Object>
Returs a trivia question from the given options.
Param | Type | Optional | Description |
---|---|---|---|
[options] | Object | True | The options for Trivia API |
[options.encoding] | String | True | The encoding format of the result, either urlLegacy , url3986 and base64 . |
Example
const Trivia = require('trivia-api')
const trivia = new Trivia({ encoding: 'url3986' });
Promise.<Object>
Returs the available categories of the trivia questions.
Kind: global function
Returns: Promise.<Object>
- Resolves available trivia categories and their IDs
Example
trivia.getCategories()
.then(console.log)
.catch(console.error);
Promise.<Object>
Returs a trivia question from the given options.
Kind: global function
Returns: Promise.<Object>
- Resolves available trivia questions
Param | Type | Optional | Default | Description |
---|---|---|---|---|
[options] | Object | True | The options for retrieving the question | |
[options.amount] | String | True | 1 | The amount of question(s) to be retrieved |
[options.difficulty] | String | True | The difficulty of question(s) to be retrieved, either easy , medium or hard | |
[options.category] | Number | True | The category ID from which the question(s) should be retrieved | |
[options.type] | String | True | The type of question(s) to be retrieved, either multiple or boolean |
Example
let options = {
type: 'boolean',
amount: 10,
difficulty: 'hard'
};
trivia.getQuestions(options)
.then(questions => console.log(questions))
.catch(console.error);
If you liked this project you can ⭐ Star it on GitHub and/or send a thank you note to me.
FAQs
A nodejs module for getting trivia questions in all your fancy projects, in a pretty simple way.
The npm package trivia-api receives a total of 0 weekly downloads. As such, trivia-api popularity was classified as not popular.
We found that trivia-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.