Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drylikov/async-listen
Promisify server.listen for your HTTP/HTTPS/TCP server.
https://github.com/drylikov/async-listen
Last synced: 8 days ago
JSON representation
Promisify server.listen for your HTTP/HTTPS/TCP server.
- Host: GitHub
- URL: https://github.com/drylikov/async-listen
- Owner: drylikov
- License: mit
- Created: 2024-06-20T12:51:15.000Z (5 months ago)
- Default Branch: drylikov
- Last Pushed: 2024-06-20T20:56:37.000Z (5 months ago)
- Last Synced: 2024-06-22T04:52:28.156Z (5 months ago)
- Language: TypeScript
- Size: 38.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: Security
Awesome Lists containing this project
README
# Async-listen
Promisify `server.listen` for your HTTP/HTTPS/TCP server.
## Install
```sh
npm install async-listen
```## Usage
```typescript
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);
```