Socket
Socket
Sign inDemoInstall

jw-epub-parser

Package Overview
Dependencies
25
Maintainers
2
Versions
128
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jw-epub-parser

This tool will help you to parse and extract the needed source materials from Meeting Workbook EPUB file. Support for parsing Watchtower Study will be added in future release.


Version published
Weekly downloads
486
increased by22.11%
Maintainers
2
Created
Weekly downloads
 

Changelog

Source

3.8.0 (2023-12-19)

Bug Fixes

  • api: update logic to check schedule week date (2ad9482)

Features

  • localize: updated translation from Crowdin (0175463)

Readme

Source

JW EPUB Parser

CI CD semantic-release: angular jw-epub-parser Quality Gate Status Code Smells Maintainability Rating Security Rating Bugs Vulnerabilities

An EPUB Parser to extract the needed source materials from Meeting Workbook and Watchtower Study EPUB files.

Install

npm i jw-epub-parser

Usage

// browser
import { loadEPUB } from 'jw-epub-parser';

// node esm
import { loadEPUB } from 'jw-epub-parser/dist/node/index.js';

// node commonjs
const { loadEPUB } = require('jw-epub-parser/dist/node/index.cjs');

// sample usage
const epubJW = await loadEPUB('/path/to/file.epub');

const epubJW = await loadEPUB({ url: epubUrl });

loadEPUB(epubData)

function: asynchronous

epubData

type: string or blob or url

It can be the path to the EPUB file or EPUB file's blob or url to download the EPUB file.

Return

By calling the loadEPUB function, it will return an array of objects with the following properties:

Meeting Workbook Data
NameTypeDescription
mwb_week_datestringWeek date. For enhanced parsing, it is formatted as yyyy/mm/dd
mwb_week_date_locale*stringWeek date
mwb_weekly_bible_readingstringWeekly Bible Reading
mwb_song_firstintegerFirst song
mwb_tgw_talkstring10 min talk title of the Treasures from God’s Word
mwb_tgw_breadstringBible Reading for student
mwb_ayf_countintegerNumber of parts in Apply Yourself to the Field Ministry
mwb_ayf_part1stringPart 1 in Apply Yourself to the Field Ministry
mwb_ayf_part1_time*integerTiming of Part 1 in Apply Yourself to the Field Ministry
mwb_ayf_part1_type*stringType of Part 1 in Apply Yourself to the Field Ministry
mwb_ayf_part2stringPart 2 in Apply Yourself to the Field Ministry. This property will not be available if mwb_ayf_count is 1
mwb_ayf_part2_time*integerTiming of Part 2 in Apply Yourself to the Field Ministry. This property will not be available if mwb_ayf_count is 1
mwb_ayf_part2_type*stringType of Part 2 in Apply Yourself to the Field Ministry. This property will not be available if mwb_ayf_count is 1
mwb_ayf_part3stringPart 3 in Apply Yourself to the Field Ministry. This property will not be available if mwb_ayf_count is less than 3
mwb_ayf_part3_time*integerTiming of Part 3 in Apply Yourself to the Field Ministry. This property will not be available if mwb_ayf_count is less than 3
mwb_ayf_part3_type*stringType of Part 3 in Apply Yourself to the Field Ministry. This property will not be available if mwb_ayf_count is less than 3
mwb_ayf_part4stringPart 4 in Apply Yourself to the Field Ministry. This property will not be available if mwb_ayf_count is less than 4
mwb_ayf_part4_time*integerTiming of Part 4 in Apply Yourself to the Field Ministry. This property will not be available if mwb_ayf_count is less than 4
mwb_ayf_part4_type*stringType of Part 4 in Apply Yourself to the Field Ministry. This property will not be available if mwb_ayf_count is less than 4
mwb_song_middleintegerMiddle song
mwb_lc_countintegerNumber of parts in Living as Christians
mwb_lc_part1stringPart 1 in Living as Christians
mwb_lc_part1_time*integerTiming of Part 1 in Living as Christians
mwb_lc_part1_content*stringContent of Part 1 in Living as Christians
mwb_lc_part2stringPart 2 in Living as Christians. This property will not be available if mwb_lc_count is 1
mwb_lc_part2_time*integerTiming of Part 2 in Living as Christians. This property will not be available if mwb_lc_count is 1
mwb_lc_part2_content*stringContent of Part 2 in Living as Christians. This property will not be available if mwb_lc_count is 1
mwb_lc_cbsstringCongregation Bible Study source material
mwb_song_concludeinteger or stringConcluding song. When the song number is out of range, it will be the default text from the Meeting Workbook.
Watchtowet Study Data
NameTypeDescription
w_study_datestringWeek date. For enhanced parsing, it is formatted as yyyy/mm/dd
w_study_date_locale*stringWeek date
w_study_titlestringWatchtower Study Article Title
w_study_opening_songintegerOpening Song for the Watchtower Study
w_study_concluding_songintegerConcluding Song for the Watchtower Study

* These properties are only available when enhanced parsing is available for the language you parse.

Currently, we only support enhanced parsing for the following languages:

Enlish
French
Italian
German
Madagascar Sign Language, Malagasy
Malagasy
Portuguese Brazil
Tandroy, Tankarana
Ukrainian
Vezo

For the other languages, you may use your own method to convert these outputs according to your needs to get the needed informations. If you want to contribute and add your language in the enhanced parsing list, or edit your language rules, please follow this guide.

Sample Output

Here are how the results of this module look like:

With enhanced parsing

Meeting Workbook Data
[
  {
    mwb_week_date: '2023/09/04',
    mwb_week_date_locale: 'September 4-10',
    mwb_weekly_bible_reading: 'ESTHER 1-2',
    mwb_song_first: 137,
    mwb_tgw_talk: '“Strive to Be Modest Like Esther”',
    mwb_tgw_bread: 'Es 1:13-22 (th study 10)',
    mwb_ayf_count: 3,
    mwb_ayf_part1:
      'Discussion. Play the video Initial Call: Kingdom​—Mt 6:9, 10. Stop the video at each pause, and ask the audience the questions that appear in the video.',
    mwb_ayf_part1_time: 5,
    mwb_ayf_part1_type: 'Initial Call Video',
    mwb_ayf_part2: 'Begin with the sample conversation topic. Offer the Enjoy Life Forever! brochure. (th study 1)',
    mwb_ayf_part2_time: 3,
    mwb_ayf_part2_type: 'Initial Call',
    mwb_ayf_part3: 'w20.11 12-14 ¶3-7​—Theme: Help From Jesus and the Angels. (th study 14)',
    mwb_ayf_part3_time: 5,
    mwb_ayf_part3_type: 'Talk',
    mwb_song_middle: 106,
    mwb_lc_count: 2,
    mwb_lc_part1: 'What Your Peers Say​—Body Image',
    mwb_lc_part1_time: 5,
    mwb_lc_part1_content:
      'Discussion. Play the video. Then ask the audience: Why can it be difficult to have a balanced view of our appearance?',
    mwb_lc_part2: 'Organizational Accomplishments',
    mwb_lc_part2_time: 10,
    mwb_lc_part2_content: 'Play the Organizational Accomplishments video for September.',
    mwb_lc_cbs: 'lff lesson 56 and endnotes 6 and 7',
    mwb_song_conclude: 101,
  },
	...
]
Watchtower Study Data
[
  {
    w_study_date: '2023/11/06',
    w_study_date_locale: 'Study Article 37: November 6-12, 2023',
    w_study_title: 'Rely on Jehovah, as Samson Did',
    w_study_opening_song: 30,
    w_study_concluding_song: 3,
  },
	...
]

Without enhanced parsing

Meeting Workbook Data
[
  {
    mwb_week_date: '4-10 de septiembre',
    mwb_weekly_bible_reading: 'ESTER 1, 2',
    mwb_song_first: 137,
    mwb_tgw_talk: '“Esfuércese por ser modesto como Ester” (10 mins.)',
    mwb_tgw_bread: 'Lectura de la Biblia (4 mins.): Est 1:13-22 (th lec. 10).',
    mwb_ayf_count: 3,
    mwb_ayf_part1:
      'Video de la primera conversación (5 mins.): Análisis con el auditorio. Ponga el video Primera conversación: El Reino (Mt 6:9, 10). Detenga el video en cada pausa y haga las preguntas que aparecen en él.',
    mwb_ayf_part2:
      'Primera conversación (3 mins.): Use el tema de las ideas para conversar. Luego ofrezca el folleto Disfrute de la vida (th lec. 1).',
    mwb_ayf_part3: 'Discurso (5 mins.): w20.11 12-14 párrs. 3-7. Título: Jesús y los ángeles nos ayudan (th lec. 14).',
    mwb_song_middle: 106,
    mwb_lc_count: 2,
    mwb_lc_part1:
      'Lo que opinan otros jóvenes: La apariencia (5 mins.): Análisis con el auditorio. Ponga el video. Luego pregunte: ¿por qué puede ser difícil mantener una actitud equilibrada sobre nuestra apariencia física?',
    mwb_lc_part2:
      'Logros de la organización (10 mins.): Ponga el video Logros de la organización para el mes de septiembre.',
    mwb_lc_cbs: 'Estudio bíblico de la congregación (30 mins.): lff lección 56 y notas 6 y 7.',
    mwb_song_conclude: 101,
  },
	...
]
Watchtower Study Data
[
  {
    w_study_date: 'Artículo de estudio 37 (del 6 al 12 de noviembre de 2023)',
    w_study_title: 'Apóyese en Jehová, tal como lo hizo Sansón',
    w_study_opening_song: 30,
    w_study_concluding_song: 3,
  },
	...
]

Keywords

FAQs

Last updated on 19 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc