freearhey / iptv-checker

Node.js CLI tool for checking links in IPTV playlists

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting an error when running

idima25 opened this issue · comments

Hello,
I have just pulled down this as NPM module and trying to do a simple call (see code below)

var checker = require('iptv-checker')

checker.checkPlaylist('data/es.m3u').then(results => {
    console.log(results) 
})

but I get an error checker.checkPlaylist is not a function.

I have tried reinstalling and troubleshooting but don't understand why it throws this error. Is there something I am missing?

its a exporting a class
so import this class like
import IptvChecker from 'iptv-checker' or const IptvChecker = require("iptv-checker");
and call its methods by creating a new object of the imported class
const iptv_checker = new IptvChecker();
const results = await iptv_checker.checkPlaylist(my_playlist);