# public-address

> Resolve public IP address and hostname

Latest version **0.1.2** (published 2016-11-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install public-address
pnpm add public-address
yarn add public-address
bun add public-address
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2016-11-24 |
| First published | 2013-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Andris Reinman |
| Maintainers | andris |

## Links

- npm: https://www.npmjs.com/package/public-address
- Repository: https://github.com/andris9/public-address
- Issues: https://github.com/andris9/public-address/issues
- npm.io page: https://npm.io/package/public-address

## Recent versions

- 0.1.2 (latest) — 2016-11-24
- 0.1.1 — 2014-05-13
- 0.1.0 — 2013-12-12

## README

# public-address

Resolve the public IP address and hostname of your current machine.

This module makes a HTTP request to https://www.ipify.org/ IP resolving service.

## Installation

    npm install public-address

## Usage

    var publicAddress = require("public-address");
    publicAddress([options,] callback);

Where

  * **options** - an optional options object. Everything in this object is passed to the HTTP request object (eg. `agent`, `localAddress` etc.)
  * **callback** - function to run once the resolving succeeded or failed. Has error object and response data as arguments

The data argument for `callback` has the following properties

  * **address** - public IP address
  * **hostname** - (if available) hostname of the IP address

## Example

Resolve public IP:

    publicAddress(function(err, data){
        console.log(err || data);
    });

Example response:

    {
        "address": "193.152.61.139",
        "hostname": "gprs-inet-61-139.example.com"
    }

## License

**MIT**

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