@biblionexus-foundation/scripture-utilities
v0.0.5
Published
Utilities for working with Scripture data.
Downloads
313
Readme
scripture-utilities
Utilities for working with Scripture data.
Features
For data that conforms to USX/USJ v3.1:
- USJ to USX converter.
- USX to USJ converter.
Install
npm install @biblionexus-foundation/scripture-utilities
Usage
import { usxStringToUsj, usjToUsxString } from "@biblionexus-foundation/scripture-utilities";
const emptyUsx = '<usx version="3.1" />';
const usx = `
<?xml version="1.0" encoding="utf-8"?>
<usx version="3.1">
<book code="PSA" style="id">World English Bible (WEB)</book>
<para style="mt1">The Psalms</para>
<chapter number="1" style="c" sid="PSA 1" />
<para style="q1">
<verse number="1" style="v" sid="PSA 1:1" />Blessed is the man who doesn’t walk in the counsel of the wicked,</para>
<para style="q2" vid="PSA 1:1">nor stand on the path of sinners,</para>
<para style="q2" vid="PSA 1:1">nor sit in the seat of scoffers;<verse eid="PSA 1:1" /></para>
</usx>
`;
const emptyUsj = usxStringToUsj(emptyUsx);
const usj = usxStringToUsj(usx);
const newUsx = usjToUsxString(usj);
Building
Run nx build utilities
to build the library.
Running unit tests
Run nx test utilities
to execute the unit tests via Jest.