chapter-and-verse
Given a bible reference returns an object with the bible book, chapter, verse and more
Introduction
Throw a bible reference at chapter-and-verse
and it returns a detailed JSON object for that reference.
chapter-and-verse
understands all common bible book abbreviations and more.
It is particularly useful when dealing with complex bible APIs or raw user input.
chapter-and-verse
handles all the following reference formats:
format | example | notes |
---|
book | Genesis | |
book chapter | Genesis 5 | |
book verse | Obadiah 3 | single chapter books only |
book verses | Obadiah 3-5 | single chapter books only |
book chapter:verse | Genesis 5:1 | |
book chapter:verses | Genesis 5:1-4 | |
chapter-and-verse
is written by a professional developer, has 100% unit test coverage and is ready for production use.
Usage
const chapterAndVerse = require('chapter-and-verse')
let cv = chapterAndVerse('Dan 4:1-3')
And cv
now looks like:
{
"book": {
"id": "Dan",
"name": "Daniel",
"testament": "O",
"start": "dan",
"abbr": ["da", "dn"],
"chapters": 12
},
"reason": "matches book.id",
"chapter": 4,
"from": 1,
"to": 3,
"range": [1, 2, 3]
}
You can also use cv.toString()
and cv.toShortString()
as follows:
cv = chapterAndVerse('Dan 4:1-3')
cv.toString()
cv.toShortString()
cv = chapterAndVerse('ob 1-3')
cv.toString()
cv.toShortString()
Finally cv.getType()
returns one of 'book', 'chapter', 'verses' or 'verse'
Author says
The Lord bless you and keep you;
the Lord make his face to shine upon you and be gracious to you;
the Lord lift up his countenance upon you and give you peace.
Numbers 6:24-26 ESV