New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

usfm-js

Package Overview
Dependencies
Maintainers
13
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

usfm-js

A small library that provides functions to convert usfm to JSON and vice-versa

latest
Source
npmnpm
Version
3.4.3
Version published
Maintainers
13
Created
Source

usfm-js

Build Status npm npm codecov

This library takes in USFM text, and outputs it into a JSON format. It also takes JSON formatted scripture and outputs it into USFM.

Setup

npm install usfm-js

Usage

var usfm = require('usfm-js');
//Convert from USFM to JSON
var toJSON = usfm.toJSON(/**USFM Text**/);

//JSON to USFM
var toUSFM = usfm.toUSFM(toJSON, {forcedNewLines: true}); // if forcedNewLines is true, then USFM word and alignment markers will start on new line (defaults to false)

DOCUMENTATION

  • Expected format for usfm is standard \h \id \c \p \v
  • Expected format for JSON is the same as when exported from USFM
    •  {
         1:{
             1: "This is the first verse",
             2: "This is the second verse",
             ...
           },
          2:{
             1: "This is the first verse of the second chapter",
             2: "This is the second verse of the second chapter",
             ...
            }
       }
      

DEVELOPMENT

  • Make sure unit tests pass:

    • npm i
    • npm test

Keywords

USFM

FAQs

Package last updated on 20 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts