2.0.0 • Published 4 years ago
gotquestions v2.0.0
gotquestions
const gq = require("gotquestions");
(async () => {
await gq.fetchDataByQuery("Jesus");
/*
{
error: false,
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
articleBody: "...",
url: "..."
}
*/
})();
Installation
npm install gotquestions
Documentation
Error Handling
All errors return the following object
{
error: true,
errorStack: "..."
}
gq.fetchDataByUrl(url)
await gq.fetchDataByUrl("https://www.gotquestions.org/prophecies-of-Jesus.html");
/*
{
error: false,
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
articleBody: "...",
url: "..."
}
*/
gq.fetchDataByQuery(query, index)
await gq.fetchDataByQuery("Jesus", 0);
/*
{
error: false,
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
articleBody: "..."
}
*/
gq.search(query)
await gq.search("Jesus")
/*
{
error: false,
queryResults: [
{
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
url: "https://www.gotquestions.org/prophecies-of-Jesus.html"
},
...
]
}
*/
License
gotquestions is licensed under the MIT License.