0.1.8 • Published 10 months ago

pod-ip v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Overview

Build Status npm npm bundle size npm codecov

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:

yarn add pod-ip

or using npm:

npm install pod-ip
  1. Get IP address (ES6 module syntax)
import * as podIp from "pod-ip";
podIp.ipSync(); // ⇨ '1.1.1.1'

or using CommonJS syntax:

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

API Summary

Method
podIp.ipGet IP address asynchronously.
podIp.ipSyncGet IP address synchronously.

API

podIp.ip

Get IP address asynchronously

Example:

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

podIp.ipSync

Get IP address synchronously

Example:

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

Acknowledgements

This project was inspired by docker-ip-get and internal-ip.

0.1.8

10 months ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago