JSPM

is-loopback-addr

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 39830
  • Score
    100M100P100Q161726F
  • License MIT

Check if a IP address is a loopback address

Package Exports

  • is-loopback-addr

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-loopback-addr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-loopback-addr

Build Status dependencies Status JavaScript Style Guide

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

const isLoopbackAddr = require('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