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 🙏

© 2026 – Pkg Stats / Ryan Hefner

web-components-scripture

v1.2.5

Published

A set of web components for interacting with Christian Scripture

Readme

Scripture Web Components

jsdelivr downloads npm npm downloads


This is a set of web components for dealing with Scripture passages (i.e. the Christian bible). These web components rely on the existence of an API for looking up scripture passages. An implementation which uses Crossway's ESV Api exists in crossway.js (see the api section for details).

Quick Look:

A specific passage of scripture:

<scripture-passage api="crosswayApi" reference="Acts 17:24-25"><scripture->

scripture-passage

A list of scripture passages:

<scripture-list
  api="crosswayApi"
  reference-list='["2 Timothy 1:9", "James 1:18"]'
></scripture-list>

scripture-list

Install

Direct reference:

<!-- Load the crossway API (or provide your own, see below) -->
<script src="https://cdn.jsdelivr.net/npm/web-components-scripture@1/crossway.js"></script>
<script>
    //create the 'crosswayApi' object being referenced
    const crosswayApi = new Crossway('your-token-here');
</script>
<!-- Load the web components -->
<script src="https://cdn.jsdelivr.net/npm/web-components-scripture@1/scripture.js"></script>

NPM: This is an NPM package, but I have not tested out including this via NPM.

npm install --save web-components-scripture
//totally untested, but something like:
require('web-components-scripture/crossway.js')
const crosswayApi = new Crossway('your-token-here');
require('web-components-scripture')

Examples

See this page for examples.

Scripture Passage

<scripture-passage> class: ScripturePassage

Render a passage of scripture.

<scripture-passage open api="crosswayApi" reference="Acts 17:24-25"><scripture-passage>

Attributes

  • api (required)
    • a reference to an api object available
  • reference (required)
    • the reference to the scripture passage (in a format the api will understand)
    • e.g. Isaiah 45:22
  • open
    • whether the passage is open (i.e. expanded) or not.
    • The scripture text will be fetched the first time it's opened
    • clicking the reference summary toggle the open state

JS Usage

const passage = document.querySelector('scripture-passage.some-class');
passage.open = true;

Properties

  • passage.open: toggle the open state
  • passage.reference: the scripture reference for this element
  • passage.passages: the actual scripture text for this element. can be a String, Element, or Array of Elements.

Scripture List

<scripture-list> class: ScriptureList

Render a list scripture passages. With an expand/collapse all link.

A list of scripture passages:
<scripture-list
  open
  api="crosswayApi"
  reference-list='["2 Timothy 1:9", "James 1:18"]'
></scripture-list>

Attributes

  • api (required)
    • a reference to an api object availabe
  • reference-list (required)
    • a (JSON.parse-able) array of scripture references (in a format the api will understand)
    • e.g. ["Psalm 33:10-11", "Jeremah 10:12-13"]
    • note: probably need to use single quotes around the value, rather than double
  • open
    • whether ALL passages in the list should be open or not
    • toggles when clicking the expand/collapse all text

JS Usage

const list = document.querySelector('scripture-list.some-class');
list.open = true;

Properties

  • list.open: toggle the open state of all scripture passages
  • list.referenceList: an array of scripture references

The API

These web components rely on an API for looking up scripture passage. The API is an object (or class, etc.) which provides 2 methods: query, and linkTo.

const myApi = {
    query(reference) {
        //looks up the text for the given reference.
        //may return a String of text, or any HTML Element.
    }

    linkTo(reference) {
        //return an A tag linking to the given reference.
        //this is used for the 'see context' link on <scripture-passage>
    }
}

Crossway API

crossway.js provides an implementation which uses Crossway's ESV api. Their api requires a token to use, so you must create an instance of Crossway by providing your token.

<scripture-passage api="crosswayApi" reference="Isaiah 48:9-11"></scripture-passage>

<script src="./crossway.js"></script>
<script>
    //create the 'crosswayApi' object being referenced
    const crosswayApi = new Crossway('your-token-here');
</script>
<script src="./scripture.js"></script>