# pod-ip

> Get the IP address of a Pod in Kubernetes

Latest version **0.1.8** (published 2023-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install pod-ip
pnpm add pod-ip
yarn add pod-ip
bun add pod-ip
```

## Health

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

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2023-07-11 |
| First published | 2022-10-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12.22.0 |
| Dependencies | 2 |
| Unpacked size | 17.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | RABC Group |
| Maintainers | rabc |
| Keywords | ip, kubernetes, docker, pod, container |

## Links

- npm: https://www.npmjs.com/package/pod-ip
- Repository: https://github.com/RABC-Group/pod-ip
- Homepage: https://github.com/RABC-Group/pod-ip#readme
- Issues: https://github.com/RABC-Group/pod-ip/issues
- npm.io page: https://npm.io/package/pod-ip

## Dependencies (2)

- [execa](https://npm.io/package/execa.md) ^5.1.1
- [internal-ip](https://npm.io/package/internal-ip.md) 6

## 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

- 0.1.8 (latest) — 2023-07-11
- 0.1.7 — 2022-12-10
- 0.1.6 — 2022-12-10
- 0.1.5 — 2022-10-31
- 0.1.4 — 2022-10-31
- 0.1.3 — 2022-10-30
- 0.1.2 — 2022-10-30
- 0.1.1 — 2022-10-30
- 0.1.0 — 2022-10-30

## README

# Overview

![Build Status](https://github.com/RABC-Group/pod-ip/actions/workflows/node.yml/badge.svg)
![npm](https://img.shields.io/npm/v/pod-ip)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/pod-ip)
![npm](https://img.shields.io/npm/dm/pod-ip)
[![codecov](https://codecov.io/gh/RABC-Group/pod-ip/branch/main/graph/badge.svg)](https://codecov.io/gh/RABC-Group/pod-ip)

This package consists of a couple of utilities to get IP addresses of containers and host from inside a kubernetes pod or docker container.

## Usage

1. Install this package

using [yarn](https://classic.yarnpkg.com/en/):

```
yarn add pod-ip
```

or using [npm](https://www.npmjs.com/):

```
npm install pod-ip
```

2. Get IP address (ES6 module syntax)

```javascript
import * as podIp from "pod-ip";
podIp.ipSync(); // ⇨ '1.1.1.1'
```

or using CommonJS syntax:

```javascript
const podIp = require("pod-ip");
podIp.ipSync(); // ⇨ '1.1.1.1'
```


## API Summary

| Method  |  |
| --- | --- |
| [`podIp.ip`](#podipip) | Get IP address asynchronously.
| [`podIp.ipSync`](#podipipsync) | Get IP address synchronously.

## API

### podIp.ip

Get IP address asynchronously

Example:

```javascript
import * as podIp from "pod-ip";
podIp.ip().then(console.log); // ⇨ '1.1.1.1'
```

### podIp.ipSync

Get IP address synchronously

Example:

```javascript
import * as podIp from "pod-ip";
podIp.ipSync(); // ⇨ '1.1.1.1'
```

## Acknowledgements

This project was inspired by [docker-ip-get](https://github.com/ukalwa/docker-ip-get) and [internal-ip](https://github.com/sindresorhus/internal-ip).

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