오픈 소스로 돌아가기

오픈 소스

TypeScript · 라이선스: MIT

@midvash/bible-data

bible-data 데이터셋에서 구절, 장, 책을 가져오는 TypeScript/JavaScript SDK.

프로젝트 소개

bible-data 데이터셋 위에 만든 타입 지원 API로, npm에 @midvash/bible-data로 배포되어 있습니다. Node 18+(네이티브 fetch 사용), 브라우저, 엣지 런타임(Cloudflare Workers, Vercel Edge)에서 동작합니다. getVerse(slug, book, chapter, verse), getChapter, getBook, getBible, getVersionMetadata 같은 함수와 ALL_VERSION_SLUGS, VERSIONS_BY_LANGUAGE, KNOWN_LANGUAGES, BOOK_IDS 같은 상수를 제공합니다. configure({ baseUrl, fetch })로 설정을 바꿀 수 있어, 데이터셋의 특정 릴리스를 고정하거나 캐시, 재시도, 목킹이 들어간 fetch를 주입할 때 유용합니다. 책은 OSIS 코드(Gen, Exod, …, Rev)로 식별합니다. MIT 라이선스. 라이브러리가 제공하는 본문은 각 번역본의 라이선스(bible-data에 명시)를 따릅니다.

포함된 내용

  • getVerse / getChapter / getBook / getBible
  • 상수 ALL_VERSION_SLUGS, VERSIONS_BY_LANGUAGE, BOOK_IDS
  • 설정 가능: 사용자 지정 baseUrl, 사용자 지정 fetch
  • Node, 브라우저, 엣지 런타임에서 동작
  • 완전한 TypeScript 타입
  • 의존성 0개

설치

                npm install @midvash/bible-data
              

사용법

                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');
              

기여하기

버그를 찾았거나, 빠진 데이터가 있거나, 무언가 추가하고 싶으신가요? Pull request와 issue는 언제나 환영합니다: github.com/midvash/bible-data-js .