Getting an error when running
idima25 opened this issue · comments
idima25 commented
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?
Umar Naqeeb commented
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);