bible-chichewa
Version:
The Chichewa Bible npm package is an open source project that provides developers with a convenient way to access and work with the Chichewa translation of the Bible within their Node.js applications.
151 lines • 5.89 kB
JavaScript
;
/**
author: M2K Developments
github: https://github.com/m2kdevelopments
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.BOOK = exports.getBooks = exports.getVerseCount = exports.getChapterCount = exports.getChapter = exports.getVerses = exports.getVerse = void 0;
const books = require("./content/books.json");
/**
* Get the text of a specific verse.
*
* @param {BOOK} book - The book of the Bible.
* @param {number} chapter - The chapter number.
* @param {number} verse - The verse number.
* @returns {string} The text of the requested verse.
*/
function getVerse(book, chapter, verse) {
const verses = require(`./resources/${book.toString()}/${chapter}.json`);
return verses[verse - 1];
}
exports.getVerse = getVerse;
/**
* Get an array of verses within a specific range.
*
* @param {BOOK} book - The book of the Bible.
* @param {number} chapter - The chapter number.
* @param {number} verseStart - The starting verse number.
* @param {number} verseEnd - The ending verse number.
* @returns {Array<string>} An array of verse texts within the specified range.
*/
function getVerses(book, chapter, verseStart, verseEnd) {
const verses = require(`./resources/${book.toString()}/${chapter}.json`);
return verses.slice(verseStart - 1, verseEnd);
}
exports.getVerses = getVerses;
/**
* Get an array of verses from a specific chapter of a book in the Chichewa Bible.
*
* @param {BOOK} book - The book of the Bible.
* @param {number} chapter - The chapter number.
* @returns {Array<string>} An array of verse texts from the requested chapter.
*/
function getChapter(book, chapter) {
return require(`./resources/${book.toString()}/${chapter}.json`);
}
exports.getChapter = getChapter;
/**
* Get the number of chapters in a book.
*
* @param {BOOK} book - The book of the Bible.
* @returns {number} The number of chapters in the requested book.
*/
function getChapterCount(book) {
return books[book - 1].chapters;
}
exports.getChapterCount = getChapterCount;
/**
* Get the number of verses in a specific chapter.
*
* @param {BOOK} book - The book of the Bible.
* @param {number} chapter - The chapter number.
* @returns {number} The number of verses in the requested chapter.
*/
function getVerseCount(book, chapter) {
const verses = require(`./resources/${book.toString()}/${chapter}.json`);
return verses.length;
}
exports.getVerseCount = getVerseCount;
/**
* Get an array of book names.
*
* @returns {Array<string>} An array of book names.
*/
function getBooks() {
return books.map((book) => book.name);
}
exports.getBooks = getBooks;
/**
* Enum representing books of the Bible.
* @enum {number}
*/
var BOOK;
(function (BOOK) {
BOOK[BOOK["Genesis"] = 1] = "Genesis";
BOOK[BOOK["Exodus"] = 2] = "Exodus";
BOOK[BOOK["Leviticus"] = 3] = "Leviticus";
BOOK[BOOK["Numbers"] = 4] = "Numbers";
BOOK[BOOK["Deuteronomy"] = 5] = "Deuteronomy";
BOOK[BOOK["Joshua"] = 6] = "Joshua";
BOOK[BOOK["Judges"] = 7] = "Judges";
BOOK[BOOK["Ruth"] = 8] = "Ruth";
BOOK[BOOK["FirstSamuel"] = 9] = "FirstSamuel";
BOOK[BOOK["SecondSamuel"] = 10] = "SecondSamuel";
BOOK[BOOK["FirstKings"] = 11] = "FirstKings";
BOOK[BOOK["SecondKings"] = 12] = "SecondKings";
BOOK[BOOK["FirstChronicles"] = 13] = "FirstChronicles";
BOOK[BOOK["SecondChronicles"] = 14] = "SecondChronicles";
BOOK[BOOK["Ezra"] = 15] = "Ezra";
BOOK[BOOK["Nehemiah"] = 16] = "Nehemiah";
BOOK[BOOK["Esther"] = 17] = "Esther";
BOOK[BOOK["Job"] = 18] = "Job";
BOOK[BOOK["Psalms"] = 19] = "Psalms";
BOOK[BOOK["Proverbs"] = 20] = "Proverbs";
BOOK[BOOK["Ecclesiastes"] = 21] = "Ecclesiastes";
BOOK[BOOK["SongOfSolomon"] = 22] = "SongOfSolomon";
BOOK[BOOK["Isaiah"] = 23] = "Isaiah";
BOOK[BOOK["Jeremiah"] = 24] = "Jeremiah";
BOOK[BOOK["Lamentations"] = 25] = "Lamentations";
BOOK[BOOK["Ezekiel"] = 26] = "Ezekiel";
BOOK[BOOK["Daniel"] = 27] = "Daniel";
BOOK[BOOK["Hosea"] = 28] = "Hosea";
BOOK[BOOK["Joel"] = 29] = "Joel";
BOOK[BOOK["Amos"] = 30] = "Amos";
BOOK[BOOK["Obadiah"] = 31] = "Obadiah";
BOOK[BOOK["Jonah"] = 32] = "Jonah";
BOOK[BOOK["Micah"] = 33] = "Micah";
BOOK[BOOK["Nahum"] = 34] = "Nahum";
BOOK[BOOK["Habakkuk"] = 35] = "Habakkuk";
BOOK[BOOK["Zephaniah"] = 36] = "Zephaniah";
BOOK[BOOK["Haggai"] = 37] = "Haggai";
BOOK[BOOK["Zechariah"] = 38] = "Zechariah";
BOOK[BOOK["Malachi"] = 39] = "Malachi";
BOOK[BOOK["Matthew"] = 40] = "Matthew";
BOOK[BOOK["Mark"] = 41] = "Mark";
BOOK[BOOK["Luke"] = 42] = "Luke";
BOOK[BOOK["John"] = 43] = "John";
BOOK[BOOK["Acts"] = 44] = "Acts";
BOOK[BOOK["Romans"] = 45] = "Romans";
BOOK[BOOK["FirstCorinthians"] = 46] = "FirstCorinthians";
BOOK[BOOK["SecondCorinthians"] = 47] = "SecondCorinthians";
BOOK[BOOK["Galatians"] = 48] = "Galatians";
BOOK[BOOK["Ephesians"] = 49] = "Ephesians";
BOOK[BOOK["Philippians"] = 50] = "Philippians";
BOOK[BOOK["Colossians"] = 51] = "Colossians";
BOOK[BOOK["FirstThessalonians"] = 52] = "FirstThessalonians";
BOOK[BOOK["SecondThessalonians"] = 53] = "SecondThessalonians";
BOOK[BOOK["FirstTimothy"] = 54] = "FirstTimothy";
BOOK[BOOK["SecondTimothy"] = 55] = "SecondTimothy";
BOOK[BOOK["Titus"] = 56] = "Titus";
BOOK[BOOK["Philemon"] = 57] = "Philemon";
BOOK[BOOK["Hebrews"] = 58] = "Hebrews";
BOOK[BOOK["James"] = 59] = "James";
BOOK[BOOK["FirstPeter"] = 60] = "FirstPeter";
BOOK[BOOK["SecondPeter"] = 61] = "SecondPeter";
BOOK[BOOK["FirstJohn"] = 62] = "FirstJohn";
BOOK[BOOK["SecondJohn"] = 63] = "SecondJohn";
BOOK[BOOK["ThirdJohn"] = 64] = "ThirdJohn";
BOOK[BOOK["Jude"] = 65] = "Jude";
BOOK[BOOK["Revelation"] = 66] = "Revelation";
})(BOOK || (exports.BOOK = BOOK = {}));
//# sourceMappingURL=index.js.map