1.2.2 • Published 2 years ago

referenceparser v1.2.2

Weekly downloads
5
License
ISC
Repository
github
Last release
2 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

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.10

2 years ago

1.1.5

4 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago