From c2b55c6f0b090d308760b9de5310704ba75d8fb8 Mon Sep 17 00:00:00 2001 From: Wise Colt Date: Sat, 28 Mar 2020 02:40:32 +0300 Subject: [PATCH] bug fix and add promise feature --- example/getinfo.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/example/getinfo.js b/example/getinfo.js index 6635f47..9f8803f 100644 --- a/example/getinfo.js +++ b/example/getinfo.js @@ -1,16 +1,18 @@ const GetFlix = require('../index'); -try { - const getflix = new GetFlix('f29e56ff85f361ff01b5c5403a343021'); - getflix.getInfo('80040119', (res) => { - if (res.error) { - console.log(res.errorMsg); +const getflix = new GetFlix('d9d6007d1bcf12043db5a085ae3e5bbb'); +const getInfo = async () => { + try { + const info = await getflix.getInfo('802329261'); + if(info == null) { + console.log('null'); + } - else { - console.log(res); - } - }) -} -catch (error) { - console.log(error.message) + + } catch (error) { + // console.log(error); + } } + +getInfo(); +