USFM Parsing Libraries

I’d love to hear from others on the open source libraries that they use for USFM parsing/generating.

My goal for this topic is to share with each how we’ve addressed issues we’ve encountered. I realize that we may all be using different technology stacks and programming languages but we can learn from each other’s approaches.

Our team uses Javascript and built our own library called USFM-JS: https://www.npmjs.com/package/usfm-js
We use it in a few React projects and one command line tool.

What do you use? Is it open source and available for others to use? What issues have you encountered and how did you solve them?

1 Like

We have published another node js library this week, “usfm-grammar”.


This models the usfm structure through a grammar.
It can

  1. Validate an input usfm text, returning true/false
  2. Parse the contents and return a JSON object

Its beta release. So we haven’t identified the issues yet. But we know that we haven’t handled some markers fully, like the peripheral section, internal structure of milestones, notes etc.

4 Likes

Thanks @kavitha for sharing that!

I plan on trying the validation out in conjunction to our current parsing/conversion to JSON prior to rendering as React Components and ultimately HTML.