All Projects → ezra-bible-app → node-sword-interface

ezra-bible-app / node-sword-interface

Licence: GPL-2.0 license
JavaScript (N-API) interface to SWORD library

Programming Languages

C++
36643 projects - #6 most used programming language
javascript
184084 projects - #8 most used programming language
shell
77523 projects
python
139335 projects - #7 most used programming language
powershell
5483 projects
CMake
9771 projects
Makefile
30231 projects

Projects that are alternatives of or similar to node-sword-interface

Eloquent
Eloquent is a bible study tool for macOS
Stars: ✭ 88 (+363.16%)
Mutual labels:  bible-study
theographic-web
A linked encyclopedia of biblical people, places, periods, and passages
Stars: ✭ 19 (+0%)
Mutual labels:  bible-study
obsidian-bible-reference
Taking Bible Study note in Obsidian.md application easily. Automatically suggesting Bible Verses as references.
Stars: ✭ 60 (+215.79%)
Mutual labels:  bible-study
sabbath-school-ios
📘 Sabbath School for iOS
Stars: ✭ 46 (+142.11%)
Mutual labels:  bible-study
easy-connect
DEPRECATED: Easily add all supported connectivity methods to your mbed OS project
Stars: ✭ 14 (-26.32%)
Mutual labels:  wrapper-library
pynytimes
Use all the New York Times APIs in Python!
Stars: ✭ 22 (+15.79%)
Mutual labels:  wrapper-library
tktable
Wrapper library for Python of the homonymous Tk library.
Stars: ✭ 37 (+94.74%)
Mutual labels:  wrapper-library
eaxefx
OpenAL EAX Extension
Stars: ✭ 39 (+105.26%)
Mutual labels:  wrapper-library
YaraSharp
C# wrapper around the Yara pattern matching library
Stars: ✭ 29 (+52.63%)
Mutual labels:  wrapper-library
cxxcurses
Header only ncurses wrapper
Stars: ✭ 24 (+26.32%)
Mutual labels:  wrapper-library
OpenWeatherMap-Android-Library
A wrapper for the openweathermap REST API
Stars: ✭ 100 (+426.32%)
Mutual labels:  wrapper-library
nimLUA
glue code generator to bind Nim and Lua together using Nim's powerful macro
Stars: ✭ 96 (+405.26%)
Mutual labels:  wrapper-library
opensea
python wrapper for opensea api
Stars: ✭ 38 (+100%)
Mutual labels:  wrapper-library
v2
Version 2 of the getBible API
Stars: ✭ 34 (+78.95%)
Mutual labels:  bible-api
BibleUtilities
Set of utilities to scan, parse, and work with Bible references.
Stars: ✭ 20 (+5.26%)
Mutual labels:  bible-api

node-sword-interface

node-sword-interface is a nodejs module that wraps the SWORD library which gives access to Bible text modules and related ressources. It has been created for use within the Ezra Bible App Bible study software, but it can also be used for any other nodejs-based software that needs to interface with the SWORD library. node-sword-interface supports Bible modules and dictionary modules that are keyed with Strong's numbers. node-sword-interface works on Windows, macOS, Linux and Android (via nodejs-mobile).

The currently used SWORD version is SVN Rev. 3873 (1.9.x).

Features

node-sword-interface focusses on discovery, installation/removal and text loading of SWORD modules. It currently covers the following usecases:

  • Update SWORD repository configuration
  • List SWORD repositories
  • List remote modules (Bible modules or dictionary modules)
  • List local modules (Bible modules or dictionary modules)
  • Get a list of updated modules
  • Install a module
  • Uninstall a module
  • Get information about a module
  • Get the text of a Bible book
  • Get the text of the whole Bible
  • Search within a Bible module
  • Retrieve info based on Strong's number

Example: Installing the KJV module

The following example can be executed (after building node-sword-interface) using the following command:

node examples/install_kjv.js
const NodeSwordInterface = require('node-sword-interface');
var interface = new NodeSwordInterface();

async function installKJV() {
  console.log("Updating repository configuration ...");
  await interface.updateRepositoryConfig();

  console.log("Installing King James module");
  // Install the King James Version (Uses the internet connection to download and install the module)
  await interface.installModule('KJV');
}

installKJV().then(() => {
  console.log("Installation of KJV successfully completed!");
});

Example: Printing module info and the Gospel of Matthew (KJV)

The following example can be executed (after building node-sword-interface) using the following command:

node examples/print_kjv_matthew.js
const NodeSwordInterface = require('node-sword-interface');
var interface = new NodeSwordInterface();

function printKjvInfo() {
  // Print some module information
  var kjv = interface.getLocalModule('KJV');
  console.log(kjv.description);
  console.log(kjv.about);
}

function printMatthew() {
  // Get the verses of the Gospel of Matthew
  var verses = interface.getBookText('KJV', 'Mat');

  // Do something with the verses
  for (var i = 0; i < verses.length; i++) {
    var currentVerse = verses[i];
    var verseReference = currentVerse.chapter + ':' + currentVerse.verseNr;
    console.log(verseReference + ' '  + currentVerse.content);
  }
}

printKjvInfo();
printMatthew();

API Docs

The Javascript API of node-sword-interface is documented here.

Installation

Dependencies

Before installing node-sword-interface you need to make sure that the following dependencies are installed:

  • C++11 compiler toolchain
  • nodejs (A version that supports N-API version >= 4, like 8.16.0, 10.16.0 or 12.0.0 (see N-API Version Matrix))
  • Git
  • Mac/Linux dependencies:
    • ICU library with development headers
    • CURL library with development headers
    • CMake (for building the SWORD library)

Below you find the OS-specific instructions for installing the dependencies.

Install dependencies on Linux

These installation instructions are working on Debian/Ubuntu based Linux distributions.

To install the dependencies issue the following command on a Debian/Ubuntu based distribution:

sudo apt-get install build-essential nodejs npm libcurl4-gnutls-dev libicu-dev zlib1g-dev pkg-config cmake subversion

Install dependencies on macOS

  1. Install XCode from the App Store
  2. Install Command Line Developer Tools (contains Compiler toolchain, git, etc.) by running this command:
    xcode-select --install
  3. Install the homebrew package manager by running this command:
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  4. Install some packages with homebrew by running this command:
    brew install pkg-config cmake npm icu4c

Install dependencies on Windows

  1. Install git.
  2. Install nodejs. Important note: Ensure to install the x86 version (32-bit) of nodejs 14.x. Furthermore, when the setup assistant asks about Tools for native modules, make sure to tick the checkbox Automatically install the necessary tools. This will then install the windows build tools required to build node-sword-interface.

Tools for native addons

Install from npmjs

Once the dependencies are available you can install and build the latest node-sword-interface release from npmjs.com by issuing the following command:

npm install node-sword-interface

On Windows, you need to add --arch=ia32 at the end of the command:

npm install node-sword-interface --arch=ia32
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].