Midvash
Voltar pra Código Aberto
00 Código Aberto
TypeScript · Licença: MIT

@midvash/bible-data

SDK TypeScript/JavaScript pra ler versículos, capítulos e livros do dataset bible-data.

01 Sobre o projeto

API tipada sobre o dataset bible-data, publicada no npm como @midvash/bible-data. Funciona em Node 18+ (usa fetch nativo), em browsers e em runtimes de edge (Cloudflare Workers, Vercel Edge). Expõe funções como getVerse(slug, livro, capítulo, versículo), getChapter, getBook, getBible e getVersionMetadata, mais constantes como ALL_VERSION_SLUGS, VERSIONS_BY_LANGUAGE, KNOWN_LANGUAGES e BOOK_IDS. Aceita configuração customizada via configure({ baseUrl, fetch }) — útil pra fixar uma release específica do dataset ou pra injetar fetch com cache, retry ou mocking. Livros são identificados por códigos OSIS (Gen, Exod, …, Rev). Licença MIT. Os textos servidos pela biblioteca seguem a licença individual de cada versão (declarada em bible-data).

02 O que está incluído
  • getVerse / getChapter / getBook / getBible
  • Constantes ALL_VERSION_SLUGS, VERSIONS_BY_LANGUAGE, BOOK_IDS
  • Configurável: baseUrl customizado, fetch customizado
  • Funciona em Node, browser e edge runtimes
  • Tipos TypeScript completos
  • Zero dependências
03 Instalação
npm install @midvash/bible-data
04 Uso
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');
05 Contribuir

Achou um bug, dado faltando, ou quer adicionar algo? Pull requests e issues são bem-vindos em github.com/midvash/bible-data-js .