https://github.com/allemandi/bible-validate
Fast, type-safe utilities for parsing, validating, and normalizing Bible references.
https://github.com/allemandi/bible-validate
bible bible-api bible-books bible-format bible-parser bible-reference bible-utils bible-validation chapter-verse commonjs esm reference-parser scripture umd
Last synced: 14 days ago
JSON representation
Fast, type-safe utilities for parsing, validating, and normalizing Bible references.
- Host: GitHub
- URL: https://github.com/allemandi/bible-validate
- Owner: allemandi
- License: mit
- Created: 2025-05-25T13:53:18.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2026-02-18T00:38:12.000Z (about 1 month ago)
- Last Synced: 2026-02-18T06:44:13.710Z (about 1 month ago)
- Topics: bible, bible-api, bible-books, bible-format, bible-parser, bible-reference, bible-utils, bible-validation, chapter-verse, commonjs, esm, reference-parser, scripture, umd
- Language: JavaScript
- Homepage: https://npmjs.com/package/@allemandi/bible-validate
- Size: 234 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ @allemandi/bible-validate
[](https://www.npmjs.com/package/@allemandi/bible-validate)
[](https://github.com/allemandi/bible-validate/blob/main/LICENSE)
> **Fast, type-safe utilities for parsing, validating, and normalizing Bible references.**
>
> Works in Node.js, browsers โ supports ESM, CommonJS, UMD, and TypeScript.
## ๐ Table of Contents
- [โจ Features](#-features)
- [๐ ๏ธ Installation](#๏ธ-installation)
- [๐ Quick Usage Examples](#-quick-usage-examples)
- [๐งช Tests](#-tests)
- [๐ค Contributing](#-contributing)
## โจ 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
```bash
# 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](https://github.com/allemandi/bible-validate/blob/main/docs/API.md).
**ESM**
```js
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**
```js
const { parseAndValidateReference } = require('@allemandi/bible-validate');
```
**UMD (Browser)**
```bash
const result = window.bibleValidate.parseAndValidateReference('John 3:16');
console.log(result);
```
## ๐งช Tests
> Available in the GitHub repo only.
```bash
# 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