biblia-interface is an npm package written in TypeScript to help with easier interactions with the bibliaapi. It contains nearly full documentation for autocomplete and ease of use. This FOSS package is not affiliated with the FaithLife corporation, but is meant to help with ease of use for their api
npm install biblia-interface
let { Biblia } = require('./index.js');
//Takes an optional second parameter of a specific bible version, defaults to "asv"
let bible = new Biblia("", "byz");
Nearly every method takes an optional second object parameter with different formatting options offered by bibliaapi.
bible.getPassage("Matthew 2:1-20")
.then(res =>{
console.log(res.text)
})
//Returns an array of bibles with their information
bible.getBibles()
.then(res => {
console.log(res.bibles[0].title) // "1890 Darby Bible"
})
This queries for all the bible names
bible.getBibleNames()
.then(res => {
console.log(res[0]) //darby
})
bible.scanText("I like Genesis 1:1 and Revelation 22:21 is cool!")
.then(res => {
console.log(res.results[1].passage) //"Revelation 22:21"
})
bible.parseText("II Kgs 1:1-2, 3-5")
.then(res => {
console.log(res.passages[1].passage) // "2 Kings 1:3–5"
})
bible.search("Abraham", {limit: 5}) //The limit option only returns the first 5 results
.then(res => {
console.log(res.results[0].title) //"Genesis 22:1"
})
bible.compare("Genesis 3:1", "Genesis 3:4")
.then(res => {
console.log(res.equal); //false
})
bible.setBible("Bible_Version")
For more information on these services, visit the bibliaapi docs. If you find a bug or an improvement don't hesitate to send a pull request!