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

Comparing version 1.0.2 to 1.0.3

.yarnrc

6

index.js

@@ -1,7 +0,7 @@

const example = require('./js/example')
const cv = require('./js/cv')
const main = () => {
return example()
const main = str => {
return cv(str)
}
module.exports = main
{
"name": "chapter-and-verse",
"version": "1.0.2",
"version": "1.0.3",
"description": "Given a string returns an object with the bible book, chapter and verse",

@@ -19,2 +19,3 @@ "author": "danday74",

"chai": "^4.1.2",
"chai-subset": "^1.6.0",
"coveralls": "2.11.16",

@@ -27,3 +28,11 @@ "eslint": "^4.17.0",

},
"comment": "coveralls@2.11.16"
"comment": "coveralls@2.11.16",
"repository": {
"type": "git",
"url": "git+https://github.com/danday74/chapter-and-verse.git"
},
"bugs": {
"url": "https://github.com/danday74/chapter-and-verse/issues"
},
"homepage": "https://github.com/danday74/chapter-and-verse#readme"
}
# chapter-and-verse
[![Linux Build](https://img.shields.io/travis/danday74/chapter-and-verse/master.svg?label=linux)](https://travis-ci.org/danday74/chapter-and-verse)
[![Coverage Status](https://coveralls.io/repos/github/danday74/chapter-and-verse/badge.svg)](https://coveralls.io/github/danday74/chapter-and-verse)
[![build](https://img.shields.io/travis/danday74/chapter-and-verse/master.svg?label=linux)](https://travis-ci.org/danday74/chapter-and-verse)
[![coverage](https://coveralls.io/repos/github/danday74/chapter-and-verse/badge.svg)](https://coveralls.io/github/danday74/chapter-and-verse)
[![npm](https://img.shields.io/npm/v/chapter-and-verse.svg)](https://www.npmjs.com/package/chapter-and-verse)
[![Dependencies Status](https://david-dm.org/danday74/chapter-and-verse/status.svg)](https://david-dm.org/danday74/chapter-and-verse)
[![npm](https://img.shields.io/npm/dm/chapter-and-verse.svg)](https://www.npmjs.com/package/chapter-and-verse)
[![dependencies](https://david-dm.org/danday74/chapter-and-verse/status.svg)](https://david-dm.org/danday74/chapter-and-verse)
[![downloads](https://img.shields.io/npm/dm/chapter-and-verse.svg)](https://www.npmjs.com/package/chapter-and-verse)
**Given a string returns an object with the bible book, chapter and verse**
<br>
## 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 | |
<br>
## Usage
```javascript 1.7
const chapterAndVerse = require('chapter-and-verse')
let cv = chapterAndVerse('Dan 4:1-3')
```
And `cv` now looks like:
```json
{
"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:
```javascript 1.7
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
```
<br>
## 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](https://www.biblegateway.com/passage/?search=Numbers+6%3A24-26&version=ESV "Jesus loves you")
<br><br><br>

Sorry, the diff of this file is not supported yet

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