chapter-and-verse
Given a string returns an object with the bible book, chapter and verse
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 | |
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()
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