epg-grabber 0.28.0 → 0.28.1

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.
@@ -5,7 +5,7 @@ const program = new Command()
5
5
  const { merge } = require('lodash')
6
6
  const { gzip } = require('node-gzip')
7
7
  const file = require('../src/file')
8
- const EPGGrabber = require('../src/index')
8
+ const { EPGGrabber, parseChannels, generateXMLTV, loadLogo } = require('../src/index')
9
9
  const { create: createLogger } = require('../src/logger')
10
10
  const { parseInteger, getUTCDate } = require('../src/utils')
11
11
  const { name, version, description } = require('../package.json')
@@ -63,7 +63,7 @@ async function main() {
63
63
  const grabber = new EPGGrabber(config)
64
64
 
65
65
  const channelsXML = file.read(config.channels)
66
- const { channels } = grabber.parseChannels(channelsXML)
66
+ const { channels } = parseChannels(channelsXML)
67
67
 
68
68
  let programs = []
69
69
  let i = 1
@@ -95,7 +95,7 @@ async function main() {
95
95
  }
96
96
  }
97
97
 
98
- const xml = grabber.generateXMLTV({ channels, programs })
98
+ const xml = generateXMLTV({ channels, programs })
99
99
  let outputPath = options.output || config.output
100
100
  if (options.gzip) {
101
101
  outputPath = outputPath || 'guide.xml.gz'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epg-grabber",
3
- "version": "0.28.0",
3
+ "version": "0.28.1",
4
4
  "description": "Node.js CLI tool for grabbing EPG from different sites",
5
5
  "main": "src/index.js",
6
6
  "preferGlobal": true,
package/src/index.js CHANGED
@@ -6,6 +6,9 @@ const { parse: parsePrograms } = require('./programs')
6
6
  const { load: loadConfig } = require('./config')
7
7
  const { sleep, isPromise } = require('./utils')
8
8
 
9
+ module.exports.generateXMLTV = generateXMLTV
10
+ module.exports.parseChannels = parseChannels
11
+
9
12
  class EPGGrabber {
10
13
  constructor(config = {}) {
11
14
  this.config = loadConfig(config)
@@ -42,7 +45,4 @@ class EPGGrabber {
42
45
  }
43
46
  }
44
47
 
45
- EPGGrabber.prototype.generateXMLTV = generateXMLTV
46
- EPGGrabber.prototype.parseChannels = parseChannels
47
-
48
- module.exports = EPGGrabber
48
+ module.exports.EPGGrabber = EPGGrabber
@@ -2,7 +2,7 @@
2
2
  * @jest-environment node
3
3
  */
4
4
 
5
- import EPGGrabber from '../src/index'
5
+ import { EPGGrabber } from '../src/index'
6
6
  import axios from 'axios'
7
7
 
8
8
  jest.mock('axios')