# get-server-address

> Get the address of a server.

Latest version **1.0.1** (published 2019-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-server-address
pnpm add get-server-address
yarn add get-server-address
bun add get-server-address
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-01-17 |
| First published | 2019-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | jameslnewell |

## Links

- npm: https://www.npmjs.com/package/get-server-address
- Repository: https://github.com/jameslnewell/get-server-address
- Homepage: https://github.com/jameslnewell/get-server-address#readme
- Issues: https://github.com/jameslnewell/get-server-address/issues
- npm.io page: https://npm.io/package/get-server-address

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) ^9.6.40

## Recent versions

- 1.0.1 (latest) — 2019-01-17
- 1.0.0 — 2019-01-17

## README

# get-server-address

Get the address of a server.

## Installation

```
yarn
```

## Usage

The following code will output: `Listening at http://[::]:8888`.

```js
import {createServer} from 'http';

const server = createServer();

server.listen(8888, () => {
  const address = getServerAddress(server);
  console.log(`Listening at ${address}`);
});

```

> Will work with `express`, `connect` or any other server that imitates `Server` from the `net` module.

---
_Source: https://npm.io/package/get-server-address · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
