Socket
Socket
Sign inDemoInstall

self-ip

Package Overview
Dependencies
2
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    self-ip

Get self IP addresses


Version published
Maintainers
2
Install size
76.5 kB
Created

Readme

Source

self-ip  npm build License

Get self IP addresses

Features

  • Supports TypeScript
  • Supports both CommonJS and ESModules

Getting Started

$ npm install --save self-ip # for npm users
$ yarn add self-ip           # for yarn users

Breaking Changes

There are breaking changes in v1.0.0. See the release note for more details.

Usage

import { ip, ipv4, ipv6 } from 'self-ip'

ip()
// ==> { v4: ['192.0.0.2'], v6: ['ffff::abcd:1234:1234:5678'] }

ipv4()
// ==> ['192.0.0.2']

ipv6()
// ==> ['ffff::abcd:1234:1234:5678']

Reference

ip([ checker ])

Get both IPv4 and IPv6 self-addresses

  • checker(addrs, name) (function): check if it is a loopback network interface or not
  • Result (Object): { v4: ['v4addr'], v6: ['v6addr'] }

ipv4([ checker ])

Get IPv4 self-addresses

  • checker(addrs, name) (function): check if it is a loopback network interface or not
  • Result (Array): ['v4addr']

ipv6([ checker ])

Get IPv6 self-addresses

  • checker(addrs, name) (function): check if it is a loopback network interface or not
  • Result (Array): ['v6addr']

License

MIT © Pine Mizune

FAQs

Last updated on 24 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc