Skip to content

Getting Started

Best Codes edited this page Jul 25, 2024 · 3 revisions

Here's an improved version of the GitHub wiki page for "Getting Started":

Getting Started with Best Bible

Welcome to Best Bible, a comprehensive JavaScript package for accessing and working with biblical content. This guide will help you quickly set up and start using Best Bible in your project.

Installation

Best Bible is available on major JavaScript package managers. Choose your preferred method:

npm

npm install best-bible@latest

Yarn

yarn add best-bible

Other Package Managers

Best Bible is also available on Socket. For alternative installation methods, please refer to your package manager's documentation.

Manual Installation

You can also download the ZIP file directly from our GitHub repository.

Browser Support

Using the browser script is not recommended, as it combines the utils/, src/, and data/bible.json files. This means it is quite large and can slow down your initial page load time dramatically. To help with this, you can wait until after the page has loaded to inject the script, or simply use the npm package with a framework as intended.

If you still want to use the browser package, you can do so by adding the following script tag to your HTML head or body element:

<script src="https://cdn.jsdelivr.net/npm/best-bible@latest/dist/browser/best-bible.min.js"></script>

Browser usage will be the same as the npm package except by prefixing functions with the BestBible namespace. See below:

// Example in Node
import { getVerse } from 'best-bible';
const verse = getVerse("John", 3, 16);
console.log(verse);
// Example in browser
// Optionally, if you don't inject the script after page load, wait for the script itself to load before using it
document.addEventListener("DOMContentLoaded", function () {
  const verse = BestBible.getVerse('John', 3, 16);
  console.log(verse);
});

Thank you for choosing Best Bible. We hope it enhances your biblical studies and projects!

Clone this wiki locally