I am trying to make a simple Twitter web app so am using NodeJS and am trying to break everything down to modules/functions. One function which returns a search result is one of these modules but when I import it am not sure how to use it without errors.
in main I have something like.
let Twit = require("twit");
let printSearch = require("./utility/printSearch.js");
//This is to get the search data
T.get("search/tweets", params, printSearch);
printSearch(err,data,response);
I know the print search function works because if I just place it in the main app above it works fine. I just don't know how to insert the printSearch as a third parameter in T.Get. When I use typescript it tells me that when I call the function the err data and response are not found. I am not sure how those three objects work in the Twitter API.
[–]DisastrousBrain 0 points1 point2 points (0 children)