JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2550072
  • Score
    100M100P100Q194324F
  • License MIT

`net.Server#listen()` helper that returns a Promise for async / await

Package Exports

  • async-listen
  • async-listen/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (async-listen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

async-listen

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

Install

$ npm install async-listen --save

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