tomas / needle

Nimble, streamable HTTP client for Node.js. With proxy, iconv, cookie, deflate & multipart support.
https://www.npmjs.com/package/needle
MIT License
1.63k stars 236 forks source link

why not let needle.get return a promise if no callback is given? #365

Closed erf closed 3 years ago

erf commented 3 years ago

Why not let needle.get return a promise if no callback is given?

Then i could simply do:

    const res = await needle.get(uri, params)
tomas commented 3 years ago

Yes, also right. Do you have time for a PR? :)

erf commented 3 years ago

I'd like to help, but I'm a little hesitant as i have not done a lot of javascript work in a while, and i don't know your codebase well, but i can try if i find time.