@eunchurn/ipaddress
TypeScript icon, indicating that this package has built-in type declarations

0.3.5 • Public • Published

@eunchurn/ipaddress

npm npm version GitHub version License: MIT

Getting public IP address

Installation

yarn add @eunchurn/ipaddress

Usage

getIPAddresses

function getIPAddresses();

실제 물리적 네트워크 인터페이스의 IP주소를 가져옴 (sync)

import { getIPAddresses } from "@eunchurn/ipaddress";

const ipAddress = getIPAddresses(); // IP Address

getNetworkIP

function getNetworkIP(callback: (error: Error | undefined, data: string) => void);

www.google.com을 연결하는 인터페이스의 IP주소를 가져옴: 이더넷 혹은 Wi-Fi 연결을 동시에 사용하거나, 여러 네트워크 인터페이스가 열려있는 경우 실제 네트워크 주소를 가져옴.

import { getNetworkIP } from "@eunchurn/ipaddress";

getNetworkIP((error, data) => {
  console.log(data); // IP Address
});

Package Sidebar

Install

npm i @eunchurn/ipaddress

Weekly Downloads

1

Version

0.3.5

License

MIT

Unpacked Size

8.71 kB

Total Files

15

Last publish

Collaborators

  • eunchurn