package
`net.Server#listen()` helper that returns a Promise for async / await
npm install async-listenGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
11.2 kB
Includes dependencies.
Promisify server.listen for your HTTP/HTTPS/TCP server.
npm install async-listenimport listen from 'async-listen';
import { createServer } from 'http';
async function main() {
const port = 3000;
const server = createServer();
const address = await listen(server, port);
console.log(address); // => URL('http://127.0.0.1:3000')
}
main().catch(console.error);ethan_arrowood
ethan@arrowood.dev