Skip to content

Commit f619d64

Browse files
committed
refactor code and add readme
1 parent bb0ea50 commit f619d64

4 files changed

Lines changed: 496 additions & 195 deletions

File tree

README.MD

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,57 @@
1-
Scripture-API Node Interface
1+
# Scripture-API Node Interface
2+
A Node interface to access the APIs provided by [API.Bible
3+
](https://scripture.api.bible/)
4+
5+
6+
## Pre Step
7+
SignUp on [API.Bible](https://scripture.api.bible/) and generate your api token
8+
9+
## Installation
10+
```
11+
npm install scripture-api-node --save
12+
```
13+
14+
## Usage
15+
```
16+
const ScriptureApi = require('scripture-api-node');
17+
const scriptureApi = new ScriptureApi('YOUR_API_TOKEN_HERE');
18+
```
19+
20+
### Fetch all bibles
21+
```js
22+
const params = {
23+
language: 'eng', // ISO 639-3 three digit langage code used to filter results, (optional)
24+
abbreviation: 'kjv', // Bible abbreviation to search for (optional)
25+
name: 'king james version', // Bible name to search for (optional)
26+
ids: 'de4e12af7f28f599-01,...' // Comma separated list of Bible Ids to return (optional)
27+
}
28+
29+
scriptureApi.getBibles(params)
30+
.then((data) => {
31+
console.log(data);
32+
})
33+
.catch((error) => {
34+
console.log(error);
35+
});
36+
```
37+
38+
### Fetch a Bible
39+
```js
40+
const bibleId = 'de4e12af7f28f599-01' // Id of Bible to be fetched(required)
41+
scriptureApi.getBible(bibleId)
42+
.then((data) => {
43+
console.log(data);
44+
})
45+
.catch((error) => {
46+
console.log(error);
47+
});
48+
49+
```
50+
51+
52+
53+
### Copyright
54+
* The author of this code has no formal relationship with https://scripture.api.bible/ and does not
55+
* claim to have created any of the facilities provided by https://scripture.api.bible/
56+
57+
(c) [@olawalejarvis](https://github.com/olawalejarvis)

index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* This module provides access to Scripture API Bible API
3+
* https://scripture.api.bible/
4+
*
5+
* The API provides access to fetch bibles, bible's books, bible's chapters, bible's verses and sections in the bible
6+
*
7+
* The author of this code has no formal relationship with https://scripture.api.bible/ and does not
8+
* claim to have created any of the facilities provided by https://scripture.api.bible/
9+
*/
10+
11+
module.exports = require('./src');

0 commit comments

Comments
 (0)