1.2.2 • Published 3 years ago

referenceparser v1.2.2

Weekly downloads
5
License
ISC
Repository
github
Last release
3 years ago

ReferenceParser

TLDR: Parse likely bible references from strings like "Jn3.16" or "1 Cor 13"

This is a simple library designed to infer an intended verse reference given a string. It is used in url parsing by https://parabible.com so that users can use any book abbreviations they want to use while also providing support for a standard set of urls.

Usage is simple

Step One: Add ReferenceParser to your project:

npm i referenceparser --save

Step Two: Import or require it somewhere in your code base and then instantiate it:

import ReferenceParser from 'referenceparser'
const rp = new ReferenceParser()

Step Three: Parse some text...

rp.parse("2 Kings 5:3")
//  { book: '2 Kings', chapter: 5, verse: 3 }

rp.parse("pss4.2")
//  { book: 'Psalms', chapter: 4, verse: 2 }

rp.parse("song of sol 10v4")
//  { book: 'Song of Songs', chapter: 10, verse: 4 }

rp.parse("ex")
//  { book: 'Exodus', chapter: null, verse: null }

rp.parse("2-kgs/3")
//  { book: '2 Kings', chapter: 3, verse: null }

rp.parse("garbage")
//  { book: null, chapter: null, verse: null }
1.2.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.10

4 years ago

1.1.5

5 years ago

1.1.4

6 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago