Torna all'Open Source

Open Source

TypeScript · Licenza: MIT

@midvash/bible-data

SDK TypeScript/JavaScript per leggere versetti, capitoli e libri dal dataset bible-data.

Il progetto

API tipizzata sul dataset bible-data, pubblicata su npm come @midvash/bible-data. Funziona in Node 18+ (fetch nativo), nei browser e nei runtime edge (Cloudflare Workers, Vercel Edge). Espone funzioni come getVerse(slug, libro, capitolo, versetto), getChapter, getBook, getBible e getVersionMetadata, oltre a costanti come ALL_VERSION_SLUGS, VERSIONS_BY_LANGUAGE, KNOWN_LANGUAGES e BOOK_IDS. Accetta una configurazione personalizzata con configure({ baseUrl, fetch }): utile per fissare una release specifica del dataset o per iniettare un fetch con cache, retry o mock. I libri sono identificati da codici OSIS (Gen, Exod, …, Rev). Licenza MIT. I testi serviti dalla libreria seguono la licenza di ciascuna versione (dichiarata in bible-data).

Cosa include

  • getVerse / getChapter / getBook / getBible
  • Costanti ALL_VERSION_SLUGS, VERSIONS_BY_LANGUAGE, BOOK_IDS
  • Configurabile: baseUrl personalizzato, fetch personalizzato
  • Funziona in Node, nel browser e nei runtime edge
  • Tipi TypeScript completi
  • Zero dipendenze

Installazione

                npm install @midvash/bible-data
              

Utilizzo

                import { getVerse, getChapter, getBook } from '@midvash/bible-data';

// John 3:16 in the King James Version
const verse = await getVerse('kjv', 'John', 3, 16);
console.log(verse.text);
// "For God so loved the world, that he gave his only begotten Son..."

// All of John 3 in the World English Bible
const chapter = await getChapter('web', 'John', 3);

// The whole book of Genesis in Latin (Vulgate)
const genesis = await getBook('vulg', 'Gen');
              

Contribuire

Hai trovato un bug, mancano dei dati o vuoi aggiungere qualcosa? Pull request e issue sono benvenute su github.com/midvash/bible-data-js .