async-listen
`net.Server#listen()` helper that returns a Promise for async / await
Last updated 2 years ago by vercel-release-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install async-listen 
SYNC missed versions from official npm registry.

async-listen

Promisify server.listen for your HTTP/HTTPS/TCP server.

Install

npm install async-listen

Usage

import 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);

Current Tags

  • 3.1.0                                ...           latest (2 years ago)

11 Versions

  • 3.1.0                                ...           2 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.3                                ...           4 years ago
  • 2.0.2                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 1.2.0                                ...           8 years ago
  • 1.1.1                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.0                                ...           10 years ago
Downloads
Total 23
Today 0
This Week 0
This Month 23
Last Day 0
Last Week 19
Last Month 0
Dependencies (0)
None
Dev Dependencies (5)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE