npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

api.bible-api

v1.0.5

Published

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

Downloads

4

Readme

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. It 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 implement the parse method. Then, provide your verse parser to the constructor of the ApiBibleUtility instance.

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', new MyParser() );
await utility.loadEntireBible( 'path-to-file.json' );

DefaultVerseParser

This parser reduces multiple white spaces to a single space and leaves special words and phrase that were added by the translators intact. For example, in the KJV, words that were added to clarify the text and are usually printed in italics are preserved.

Note that the verse parser can be used with verse data returned by the ApiBibleBaseAPI, without the use of the ApiBibleUtility class. This facilitates implementing your own utility class without having to create your own parser, when the default parser meets your needs.

Verse parsing has some intricacies in how the text is provided by the api. A study of the returned data and an understanding of Bible text is needed to create a custom parser.