Socket
Socket
Sign inDemoInstall

chapter-and-verse

Package Overview
Dependencies
1
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    chapter-and-verse

Given a string returns an object with the bible book, chapter and verse


Version published
Weekly downloads
6
increased by200%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

chapter-and-verse

build coverage npm dependencies downloads

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:

formatexamplenotes
bookGenesis
book chapterGenesis 5
book verseObadiah 3single chapter books only
book versesObadiah 3-5single chapter books only
book chapter:verseGenesis 5:1
book chapter:versesGenesis 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() // returns 'Daniel 4:1-3'
cv.toShortString() // returns 'Daniel 4:1-3' .. no difference because Daniel has multiple chapters

cv = chapterAndVerse('ob 1-3')
cv.toString() // returns 'Obadiah 1:1-3'
cv.toShortString() // returns 'Obadiah 1-3' .. difference because Obadiah only has a single chapter

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




FAQs

Last updated on 08 Feb 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc