# iip

> Tiny local IP library

Latest version **1.0.0** (published 2016-01-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install iip
pnpm add iip
yarn add iip
bun add iip
```

## 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.0.0 |
| Published | 2016-01-02 |
| First published | 2016-01-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | https://github.com/indieforger |
| Maintainers | indieforger |
| Keywords | ip, myip, localip, interface, iface |

## Links

- npm: https://www.npmjs.com/package/iip
- Repository: https://github.com/indieforger/iip
- Homepage: https://github.com/indieforger/iip#readme
- Issues: https://github.com/indieforger/iip/issues
- npm.io page: https://npm.io/package/iip

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-01-02

## README

# iip - Tiny local IP library

Interface IP is tiny library with few helper methods returning taking `opt` as parameter and returning simple interface information.

`opts` param is an object with two propeties: 
- `family` - should be either 'IPv4' or 'IPv6'
- `iface` - should be one of the available interfaces, eg: 'lo0', 'en0'

Not passing `opts` param into helper will result in default values
```
{ family: 'IPv4', iface: 'en0' }
```

### `getInfo(opts)`
Returns info object from the interface.

```
console.log(iip.getInfo())
console.log(iip.getInfo({ family: 'IPv4', iface: 'en0' }))
```

### `getIP(opts)`
Returns local interface address.

```
console.log(iip.getIP({ family: 'IPv4', iface: 'en0' }))
console.log(iip.getIP())
console.log(iip.getInfo().address)
```

### `getIP(opts)`
Returns interface mac address.
```
console.log(iip.getMac({ family: 'IPv6' }))
console.log(iip.getMac())
```

### `getIP(opts)`
Returns interface mac netmask.
```
console.log(iip.getMask({ family: 'IPv6' }))
console.log(iip.getMask())
```


### `getAll()`
Returns all interface
```
console.log(iip.getAll())
```

equivalent to
```
require('os').networkInterfaces();
```

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