alxhotel / nat-api

:left_right_arrow: Fast port mapping with UPnP and NAT-PMP
MIT License
23 stars 12 forks source link

Use promises instead of callbacks (async) #6

Open betamos opened 4 years ago

betamos commented 4 years ago

Anecdote: I successfully used es6-promisify with this module:

const client = new NatAPI()
const asyncMap = promisify(client.map.bind(client))
// ...
await asyncMap({..})

Would you consider a PR to make the API use promises entirely? I'm unsure of how legacy interoperability in node-land is handled so maybe it's not desirable, please let me know.