Socket
Socket
Sign inDemoInstall

is-loopback-addr

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-loopback-addr

Check if a IP address is a loopback address


Version published
Weekly downloads
15K
decreased by-21.63%
Maintainers
1
Install size
7.15 kB
Created
Weekly downloads
 

Changelog

Source

2.0.2 (2023-08-14)

Trivial Changes

  • add or force update .github/workflows/js-test-and-release.yml (#101) (743d5b9)
  • delete templates [skip ci] (#100) (5d77ba9)

Readme

Source

is-loopback-addr

Build Status dependencies Status JavaScript Style Guide Downloads Minzipped size codecov

Check if a IP address is a loopback address

Various Internet Engineering Task Force (IETF) standards reserve the IPv4 address block 127.0.0.0/8 and the IPv6 address ::1/128 for this purpose. The most common IPv4 address used is 127.0.0.1. Commonly these loopback addresses are mapped to the hostnames, localhost or loopback. For more information check rfc5735 and rfc3513.

Install

npm i is-loopback-addr

Usage

import { isLoopbackAddr } from 'is-loopback-addr'

console.log(isLoopbackAddr('127.0.0.1')) // true
console.log(isLoopbackAddr('192.168.0.1')) // false
console.log(isLoopbackAddr('22.2.0.1')) // false
console.log(isLoopbackAddr('::1')) // true
console.log(isLoopbackAddr('2001:8a0:7ac5:4201:3ac9:86ff:fe31:7095')) // false

Contribute

Feel free to dive in! Open an issue or submit PRs.

License

MIT © Vasco Santos

FAQs

Last updated on 14 Aug 2023

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