# nat-upnp-wrapper

> A nat-upnp wrapper.

Latest version **1.5.0** (published 2018-12-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install nat-upnp-wrapper
pnpm add nat-upnp-wrapper
yarn add nat-upnp-wrapper
bun add nat-upnp-wrapper
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2018-12-31 |
| First published | 2018-12-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andres Sweeney-Rios |
| Maintainers | andrewrivers |
| Keywords | upnp |

## Links

- npm: https://www.npmjs.com/package/nat-upnp-wrapper
- Issues: https://github.com/Andr3wRiv3rs/nat-upnp-wrapper/issues
- npm.io page: https://npm.io/package/nat-upnp-wrapper

## Dependencies (1)

- [nat-upnp](https://npm.io/package/nat-upnp.md) ^1.1.1

## Recent versions

- 1.5.0 (latest) — 2018-12-31
- 1.4.9 — 2018-12-30
- 1.4.8 — 2018-12-30
- 1.4.7 — 2018-12-30
- 1.4.6 — 2018-12-30
- 1.4.5 — 2018-12-30
- 1.4.4 — 2018-12-30
- 1.4.3 — 2018-12-30
- 1.4.1 — 2018-12-30
- 1.4.0 — 2018-12-30
- 1.0.0 — 2018-12-30

## README

#nat-upnp-wrapper
This is a wrapper for the nat-upnp module.

##Script Usage

**Map port**
```js
const mapper = require('nat-upnp-wrapper');
mapper.map(options).then(response => console.log(response.success));
```
Options:

```js
{
    "port": 80, // or [public,private]
    "ports": [80,443,[8081,8082]], // takes priority
    "protocol": "UDP" // defaults to "TCP"
}
```


**Unmap port**
```js
mapper.unmap(options).then(response => ...);
```

Options

```js
{
    "port": 80,
    "ports": [80,443,8081],
    "protocol": "UDP"
}
```


**Get Mappings**
```js
mapper.mappings(true).then(response => console.log(response.results));
```
Set to `true` for local results. Defaults to `false`.


**Get Public IP Address**
```js
mapper.ip().then(ip => console.log(ip));
```

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