Utilities for working with Scripture data.
npm install @eten-tech-foundation/scripture-utilities[![Build Status][github-actions-status]][github-actions-url]
[![CodeQL][gitghub-codeql-status]][gitghub-codeql-url]
[![Github Tag][npm-version-image]][npm-version-url]
Utilities for working with Scripture data.
For data that conforms to USX/USJ v3.1:
- USJ to USX converter.
- USX to USJ converter.
``sh`
npm install @eten-tech-foundation/scripture-utilities
`ts
import { usxStringToUsj, usjToUsxString } from "@eten-tech-foundation/scripture-utilities";
const emptyUsx = '
const usx =
;
const emptyUsj = usxStringToUsj(emptyUsx);
const usj = usxStringToUsj(usx);
const newUsx = usjToUsxString(usj);
`
Run nx build utilities to build the library.
Run nx test utilities to execute the unit tests via Vitest.
To develop these utilities in a target application you can use yalc to link the editor in without having to publish to NPM every time something changes.
1. In this monorepo, publish the editor to yalc, e.g.:`
bash`
nx devpub utilities
yalc
2. In the target application repo, link from :`
bash`
yalc link @eten-tech-foundation/scripture-utilities
yalc
3. In this monorepo, make changes and re-publish the editor (see step 1).
4. When you have finished developing in the target application repo, unlink from :`
bash``
yalc remove @eten-tech-foundation/scripture-utilities && npm i
[MIT][github-license] © ETEN Tech Foundation
[github-actions-status]: https://github.com/eten-tech-foundation/scripture-editors/actions/workflows/test-publish.yml/badge.svg
[github-actions-url]: https://github.com/eten-tech-foundation/scripture-editors/actions
[gitghub-codeql-status]: https://github.com/eten-tech-foundation/scripture-editors/actions/workflows/codeql.yml/badge.svg
[gitghub-codeql-url]: https://github.com/eten-tech-foundation/scripture-editors/actions/workflows/codeql.yml
[npm-version-image]: https://img.shields.io/npm/v/@eten-tech-foundation/scripture-utilities
[npm-version-url]: https://github.com/eten-tech-foundation/scripture-editors/releases
[github-license]: https://github.com/eten-tech-foundation/scripture-editors/blob/main/packages/utilities/LICENSE