npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bible-help/chapters-and-verses-in-bible-books

v1.0.1

Published

Get the chapters and verses in each book / chapter of the Bible, and the index for each verse.

Readme

Chapters and Verses in Bible Books

Get information about chapters and verses in Bible books. This module provides functions to retrieve the number of chapters in a book, verses in a book, verses in a specific chapter, and convert OSIS references to verse indices.

Associated Projects

For a interactive bible using the berean translation then take a look at: ai-BIBLE

For a mcp-server (Model Context Protocol) that you plugin to Claude Desktop and use to lookup bible verses then have a look at: MPC-Server

For a completions api that you can use with Open WebUI or Chat GPT via the completions api then have a look at: Completions-API-Server

Install

npm install @bible-help/chapters-and-verses-in-bible-books

Usage

import { 
    getChaptersInBook, 
    getVersesInBook, 
    getVersesInChapter, 
    getIndexFromOsisRef 
} from "@bible-help/chapters-and-verses-in-bible-books";

// Get number of chapters in a book
const chaptersInGenesis = getChaptersInBook("Genesis");
console.log(chaptersInGenesis);
// Output: 50

const chaptersInGen = getChaptersInBook("Gen");
console.log(chaptersInGen);
// Output: 50

// Get total verses in a book
const versesInGenesis = getVersesInBook("Genesis");
console.log(versesInGenesis);
// Output: 1533

// Get verses in a specific chapter
const versesInPsalm119 = getVersesInChapter("Psalm", 119);
console.log(versesInPsalm119);
// Output: 176 (longest chapter in the Bible)

// Convert OSIS reference to verse index (0-based)
const index = getIndexFromOsisRef("Gen.1.1");
console.log(index);
// Output: 0 (first verse in the Bible)

const index2 = getIndexFromOsisRef("Gen.1.2");
console.log(index2);
// Output: 1

const index3 = getIndexFromOsisRef("Gen.2.1");
console.log(index3);
// Output: 31

Examples with Different Book Name Formats

The functions accept various book name formats:

// Full book names
getChaptersInBook("Genesis");     // 50
getChaptersInBook("Matthew");     // 28
getChaptersInBook("Revelation");  // 22

// Common abbreviations
getChaptersInBook("Gen");         // 50
getChaptersInBook("Matt");        // 28
getChaptersInBook("Rev");         // 22

// Single chapter books
getChaptersInBook("Obadiah");     // 1
getVersesInBook("Obadiah");       // 21
getVersesInChapter("Obadiah", 1); // 21

Error Handling

All functions return undefined for invalid inputs:

getChaptersInBook("InvalidBook");    // undefined
getVersesInChapter("Genesis", 999);  // undefined (chapter doesn't exist)
getIndexFromOsisRef("Invalid.Ref"); // undefined

Licence

This project is licensed under the MIT License.