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 🙏

© 2024 – Pkg Stats / Ryan Hefner

bible-references

v3.0.1

Published

normalise bible references

Downloads

4

Readme

Bible References

![https://api.travis-ci.org/philholden/bible-references.svg]

Parses Bible references in a forgiving way so as to enable as-you-type Bible searches. Enables lists of verses parsed:

  • John 3:16
  • Acts 2:42-47
  • Rom 3:23,5:12-14,6:12,23, Gal 3:22
  • Mrk, Rev, Rom - Eph
  • Gn 1:1; Jn 1:1
  • mark16:1,3
  • Luke 3:10ff
  • Luke 2:1\nDan 1

Features

Tolerates whitespace:

John3:16-17
John  3: 16 - 17  

Book names are case insensitive

john 3:16
JOhN 3:16

Book name are recognised in many forms:

1 samuel, 1 sam, 1 sa, 1samuel, 1s, i sa, 1 sm, 1sa, i sam, 1sam, i samuel, 1st samuel, first samuel

Comma newline and semicolon [,\n;] can be used interchangeably as group separators

Job 1:8,9, Mark 5
Job 1:8,9; Mark 5
Job 1:8;9; Mark 5
Job 1:8,9
Mark 5
Job 1:8,9,
Mark 5

Open ranges can be expressed as follows:

// range ends at end of chapter
John 3:16ff

// range ends at end of book
John 3ff

// range ends at end of Bible
John 3:16 -

Output

The output is expressed as an array of ranges:

// john 1:8,10-15,11
[
  {
    start: { book: 'john', chapter: '1', verse: '8' },
    end: { book: 'john', chapter: '1', verse: '8' },
  },
  {
    start: { book: 'john', chapter: '1', verse: '10' },
    end: { book: 'john', chapter: '1', verse: '15' },
  },
  {
    start: { book: 'john', chapter: '1', verse: '11' },
    end: { book: 'john', chapter: '1', verse: '11' },
  },
]

An end property being undefined indicates the range continues to the end of smallest defined end property. i.e:

  • end.verse === undefined range ends at end of end.chapter
  • end.chapter === undefined range ends at end of end.book
  • end.book === undefined range ends at end of Bible

How it works

We first split the input into parts using the group separator /[,;\n]+/:

'john 1:8,10-15,11' -> ['john 1:8', '10-15', '11']

Each of these parts will be mapped to a range of Bible verses. In the case above 'john 1:8' is a range that starts and ends on the same verse.

It also sets the context for the following ranges. Because 'john 1:8' specifies a verse we know any groups following that do not specify a book or chapter will be verses in John 1. However if the next range does specify a book or chapter then the context for the following ranges will be set to that book and/or chapter. Note only start books and chapters (on the left of '-') change the context for following verse.

Installation

npm install --save-dev bible-references

When setting up a new repo

semantic-release-cli setup

License

MIT