2.2.2 โ€ข Published 10 months ago

@allemandi/bible-validate v2.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

๐Ÿ“– @allemandi/bible-validate

NPM Version License: MIT

Utilities for validating and parsing Bible references

Supports ESM, CommonJS, UMD, and TypeScript โ€“ works in modern builds, Node.js, and browsers.

๐Ÿ”– Table of Contents

โœจ Features

  • Validate Bible book names and aliases
  • Get chapter and verse counts
  • Normalize references (e.g. "III John Chapter 1 verses 3 - 8" to "3 John 1:3-8")
  • Validate full references (book, chapter, verse range)
  • Parse and format Bible references with optional structured output

๐Ÿ› ๏ธ Installation

# Yarn
yarn add @allemandi/bible-validate

# or NPM
npm install @allemandi/bible-validate

๐Ÿš€ Quick Usage Examples

๐Ÿ“˜ For a complete list of methods and options, see the API docs.

ESM

import {
    parseAndValidateReference,
    isValidBook,
    getChapterCount,
} from '@allemandi/bible-validate';
const ref = 'GeN Chapter 3:  16 to 18';
const result = parseAndValidateReference(ref, {structured: true})
console.log(result);
//  {
//     isValid: true,
//     book: 'Genesis',
//     chapter: 3,
//     verseStart: 16,
//     verseEnd: 18,
//     formatted: 'Genesis 3:16-18',
//     error: null,
//     original: 'GeN Chapter 3:  16 to 18'
//   }

// Check book validity
console.log(isValidBook('Second Chronicles')); // true

// Get verse count for specific chapter in a book
console.log(getVerseCount('Rev', 3)) // 22

CommonJS

const { parseAndValidateReference } = require('@allemandi/bible-validate');

UMD (Browser)

<script src="https://unpkg.com/@allemandi/bible-validate"></script>
<script>
  const result = window.bibleValidate.parseAndValidateReference('John 3:16');
  console.log(result);
</script>

๐Ÿงช Tests

Available in the GitHub repo only.

# Run the test suite with Jest
yarn test
# or
npm test

๐Ÿค Contributing

If you have ideas, improvements, or new features:

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request
2.2.2

10 months ago

2.2.0

10 months ago

2.1.0

10 months ago

2.0.0

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.1.0

10 months ago