desmondmorris / node-twitter

Client library for the Twitter REST and Streaming API's.
https://www.npmjs.com/package/twitter
MIT License
1.27k stars 237 forks source link

Call to API in Async function does nothing #288

Open engineertdog opened 6 years ago

engineertdog commented 6 years ago

If I take a working call / use of the API and wrap it in an async function and call the function with await, then the API call won't do anything. In order to make sure that I get results in certain orders, I'm trying to organize everything with async wait functions. No error codes are thrown or anything, it's just acting like it's physically not calling the API.

Works

client.get('followers/ids', twitter_params, function(err, data) {
    // code
}

Does not work

await getTwitterFollowers();

async function getTwitterFollowers() {
    client.get('followers/ids', twitter_params, function(err, data) {
        // code
    }
}
peterpme commented 6 years ago

@engineertdog see https://github.com/Preposterous/twitter-lite