codexparser 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexparser",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "This is a Javascript Bible parser and text scanner. It will search through texts and collate all scripture references into an array and parse them into objects, and it will parse passages into objects by book, chapter, verse, and testament. ",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,9 +14,10 @@
14
14
  "@babel/core": "^7.24.0",
15
15
  "@babel/preset-env": "^7.24.0",
16
16
  "@babel/preset-react": "^7.23.3",
17
+ "axios": "^1.7.2",
17
18
  "babel-loader": "^9.1.3",
18
19
  "path": "^0.12.7",
19
20
  "webpack": "^5.90.3",
20
21
  "webpack-cli": "^5.1.4"
21
22
  }
22
- }
23
+ }
@@ -1,6 +1,7 @@
1
1
  const bible = require("./bible")
2
2
  const { bookRegex, bookAbbrRegex, chapterRegex, verseRegex, scripturesRegex, abbrScripturesRegex } = require("./regex")
3
3
  const abbrevations = require("./abbr")
4
+ const toc = require("./toc")
4
5
 
5
6
  class CodexParser {
6
7
  constructor() {
@@ -14,6 +15,7 @@ class CodexParser {
14
15
  this.scripturesRegex = scripturesRegex
15
16
  this.abbrScripturesRegex = abbrScripturesRegex
16
17
  this.abbrevations = abbrevations
18
+ this.toc = toc
17
19
  }
18
20
 
19
21
  /**
package/src/esv.js ADDED
@@ -0,0 +1,19 @@
1
+ const axios = require("axios")
2
+
3
+ // Get all books
4
+ axios
5
+ .get("https://api.esv.org/v3/passage/text/", {
6
+ params: {
7
+ q: "John+3:16",
8
+ },
9
+ headers: {
10
+ Authorization: "Token c117111babd413bd8a22b09ebfe84342dc792781",
11
+ },
12
+ })
13
+ .then((response) => {
14
+ const books = response
15
+ console.log(books.data.passage_meta)
16
+ })
17
+ .catch((error) => {
18
+ console.error(error)
19
+ })
package/src/toc.js ADDED
@@ -0,0 +1,5 @@
1
+ const fs = require("fs")
2
+
3
+ const bible = JSON.parse(fs.readFileSync(__dirname + "/../bibles/updated_kjv.json", "utf8"))
4
+
5
+ module.exports.bible = bible
package/test.js CHANGED
@@ -3,7 +3,7 @@ const CodexParser = require("./src/CodexParser.js")
3
3
  const parser = new CodexParser()
4
4
  const text =
5
5
  "The passages that we are looking at tonight are found in 1 John 3:16-17, 1 Peter 1:1, and Romans 10:13, 15, 17. Please turn in your Bibles."
6
- const single = "Ge 2:9-3:3-2 and 2 Cor 2:2"
6
+ const single = "psalm 1:1-3"
7
7
  parser.parse(single)
8
8
  //parser.parse(single)
9
9
  console.log(parser.getPassages())