New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

api-bible-api-test

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-bible-api-test

Library to facilitate use of API Bible service. https://scripture.api.bible

  • 0.1.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

API.Bible API

Library that provides a typed interface for the Api.Bible web services API.Bible

Getting started

You must first apply for an account and submit your app to API.Bible. See docs

API Levels

There are two levels of api provided by this library. The first is the ApiBibleBaseAPI. This is the lowest level and can be used to build your own services. The second, and higher level, api is ApiBibleUtility can be used to perform functions such as loading an entire bible and then saving it to disk. Note that this utility class is dependent upon the lower level api.

Verse parsing

The verse data returned by the api is in an unparsed, granular, format and must be processed to be human readable. A default parser (DefaultVerseParser) is provided that produces a format that is suitable for most uses. For example, in the KJV text, words in italics are preserved.

To provide your own parser, subclass the VerseParser class and implment the parse method.

Terminology

Bible : Collection of books.

Book : Collection of chapters and possibly notes and summaries.

Chapter : Collection of verses and notes.

Verse : Text of bible.

Example use

ApiBibleBaseAPI

Getting basic info about a bible

Bibles have a string id

const api = new ApiBibleBaseAPI( 'your-api-key' );
const bible = await api.getBible( 'bible-id' );
console.log( bible.name )

Get books of a bible
const api = new ApiBibleBaseAPI( 'your-api-key' );
const books = await api.getBooks( 'bible-id' );
Get verses of a book and chapter

Verses are returned in an unparsed format and must be constructed.

const api = new ApiBibleBaseAPI( 'your-api-key' );
const verses = await api.getVerses( 'bible-id', 'chapter-id' );

ApiBibleUtility

Load entire bible
const utility = new ApiBibleUtility( 'your-api-key', 'bible-id' );
await utility.loadEntireBible( 'path-to-file.json' );

With custom parser

const utility = new ApiBibleUtility( 'your-api-key', 'bible-id' );
await utility.loadEntireBible( 'path-to-file.json', new MyParser() );

DefaultVerseParser

FAQs

Package last updated on 14 Oct 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc